From Clomosy Docs

Inserts a substring into a string (or inserts a dynamic array into a dynamic array), beginning at a specified position.

In Clomosy code, Insert merges Source into Dest at the position Dest[Index].

Parameters

Source : The string or array elements to insert in Dest. If Source is empty, Dest is not changed.
Dest : The destination string or array, which is changed if the operation succeeds.
Index : The insertion position:
  • For a string, if Index is less than 1, it is set to 1. If it is past the end of Dest, it is set to the length of Dest, turning the operation into an append.
  • For an array, Insert inserts a dynamic array at the beginning at the position index, and returns the modified array.
Note: Index is a character index (not a byte index). But it must be incremented by 2 to pass over a surrogate pair (see the Unicode specification). When iterating or counting the characters in a Unicode string, a surrogate pair is considered to be two characters.

Example

var
 insertValue : string;

{
 insertValue = 'ClomosyLanguage';
 Insert('--', insertValue, 8);

 ShowMessage('insertValue : '+insertValue);
}

Output:

See Also