<string>.replace()

(JavaScript Function)

Note:  Look at the source code.

Code Example:

Replace one char with another one.

strSource = "Hello";
strReplaced = strSource.replace("l", "z");
strMsg += "strSource = " + strSource + "\n" + "strReplaced = " + strReplaced + "\n";

Replace all chars with another one.

strSource = "Hello";
strReplaced = strSource.replace(/l/g, "z");
strMsg += "strSource = " + strSource + "\n" + "strReplaced = " + strReplaced + "\n";