string_replace

You can use this function to parse a string looking for a specific part, which can then be replaced by the new string that you have specified.

 

Syntax:

string_replace(str, substr, newstr);

ArgumentTypeDescription
strStringThe string to be copied.
substrStringThe substring within the string to be replaced.
newstrStringThe new substring to replace the previous one.

 

Returns:

String

 

Example:

str1 = "Hello Earth";
str2 = string_replace(str1, "Earth", "World");

This will set str2 to str1, but with its instance of "Earth" replaced with "World", resulting in str2 being "Hello World".