strReplace


strReplace String

strReplace (String input, Integer start, Integer length, String insertStr)

strReplace removes length characters in the string starting at start and inserts insertStr at the start position.

Parameters:

input

the string to replace part of

start

the index within string1 to begin the replacement

length

the number of characters to remove

insertStr

the text to insert

Returns:

The string with the text replaced.

Related topics

Example:

str = "This is an example string"

str2 = strReplace(str, 8, 10, "a test")

// str2 is "This is a test string")

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*