Insert(Source: String; Start: Integer; Value: String): String;
Source. Source string.
Start. Position of substring insertion.
Value. Substring.
The Insert method inserts a substring passed as the Value input parameter into the specified place of the source string passed as the Source parameter, starting from the position specified in the Start parameter in the source string.
If the value of the Start parameter exceeds the length of the source string (the Source parameter), the substring is inserted into the end of the source string.
Sub UserProc;
Var
s, s1, s2, s3: String;
Begin
s := "abcdef";
s1 := "X";
s2 := String.Insert(s, 2, s1);
s3 := String.Insert(s, 20, s1);
End Sub UserProc;
After executing the example the "s2" variable contains the abXcdef value, and the "s3" variable contains the abcdefX value.
See also: