Returns a String in which a specified substring has been replaced with another substring a specified number of times. As an option, you can also specify a location in the string where the replacing process will begin from (returns a string starting from that position). This function is typically used in a string to systematically replace one substring with another.
Overloads
Parameters
Return value
String value.
Examples
Assume that inStrings = "abc Abc abcdfg asdfabc sdfdfd", searchString = "abc", replaceString = "ABC".
ReplaceString(inStrings, searchString, replaceString) - Returns "ABC Abc ABCdfg asdfABC sdfdfd".ReplaceString(inStrings, searchString, replaceString, 5) - Returns "abc Abc ABC dfg asdfABC sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0) - Returns "ABC Abc ABCdfg asdfABC sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0, 0) - Returns "abc Abc abcdfg asdfabc sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0, 1) - Returns "ABC Abc abcdfg asdfabc sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0, -1,1) - Returns "ABC ABC ABCdfg asdfABC sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0, -1, 0) - Returns "ABC Abc ABCdfg asdfABC sdfdfd".Note: The return value of the replace function is a String, with the specified substring replacements made, beginning at the position specified by startPosition, and endings at the end of the inString string. It is not a start to finish copy of the original string.