Inserts a substring in a string after a specified character position. If position = 0, prefixes the substring to the string.
insert(substring, String, position)
returns string
Name | Type | Required | Default | Description |
---|---|---|---|---|
substring | string | Yes | A string to insert | |
String | string | Yes | A string, which to insert substring | |
position | numeric | Yes | Substring add after this position value in given string |
To add substring on prefix of the given string
someString = ' chrome browser';
result = insert('Google', someString, 0);
writeOutput(result);
To add substring on suffix of the given string
someString = 'New private mozilla fire';
length = len(someString);
writeOutput(insert('fox', someString, length));