4D v14.3

Insert string

Home

 
4D v14.3
Insert string

Insert string 


 

Insert string ( source ; what ; where ) -> Function result 
Parameter Type   Description
source  String in String in which to insert the other string
what  String in String to insert
where  Longint in Where to insert
Function result  String in Resulting string

Insert string inserts a string into source and returns the resulting string. Insert string inserts the string what before the character at position where.

If what is an empty string (""), Insert string returns source unchanged.

If where is greater than the length of source, then what is appended to source. If where is less than one (1), then what is inserted before source.

Insert string is different from Change string in that it inserts characters instead of overwriting them.

Example  

The following example illustrates the use of Insert string. The results are assigned to the variable vtResult.

 vtResult:=Insert string("The tree";" green";4) ` vtResult gets "The green tree"
 vtResult:=Insert string("Shut";"o";3) ` vtResult gets "Shout"
 vtResult:=Insert string("Indention";"ta";6) ` vtResult gets "Indentation"

 
PROPERTIES 

Product: 4D
Theme: String
Number: 231

 
HISTORY 

Created: < 4D v6

 
SEE ALSO 

Change string
Delete string
Replace string

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)