|
Newsletters
|
|
|
|
|
WMLScript Reference
WMLScript Reference
WMLScript > String > replace()
replace() - The replace Function
Usage: replace(string, oldSubString, newSubString)
Description: Returns a new string resulting from replacing all occurrences of oldSubString in this string with newSubString.
Two strings are defined to match when they are identical. Characters with multiple possible representations match only if they have the same representation in both strings. No case folding is performed.
Example:var a = "Hello Joe. What is up Joe?";
var newName = "Don";
var oldName = "Joe";
var c = String.replace(a, oldName, newName); // c = "Hello Don. What is up Don?"
var d = String.replace(a, newName, oldName); // d = "Hello Joe. What is up Joe?"
Bookmark this page
|
|