xHarbour Reference Documentation > Function Reference |
Inserts character(s) at a specified position in a string.
PosIns( <cString>, ; <cInsert>, ; [<nPos>] ) --> cResult
The function inserts <cInsert> at the specified position into <cString> and returns the modified string.
See also: | PosDel(), PosRepl(), Stuff() |
Category: | CT:String manipulation , Character functions |
Source: | ct\pos2.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example display results of PosIns() PROCEDURE Main LOCAL cStr := "This compiler" cStr := PosIns( cStr, "is the ", 6 ) ? cStr // result: This is the compiler cStr := PosIns( cStr, "xHarbour ", 13 ) ? cStr // result: This is the xHarbour compiler RETURN
http://www.xHarbour.com