...
Scroll tablelayout | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Returns a new string with the old values replaced with new.
Scroll pagebreak |
---|
Examples
...
language | text |
---|
// Demonstrate usage of strReplace
...
string $str = "This is some text";
...
string $newStr;
...
// Replace "some" with "a bit of"
...
$newStr = `strReplace $str "some" "a bit of"`;
...
print $newStr;
...
// Should be "This is a bit of text"
...
// Remove all occurrences of "i" in the new string
...
$newStr = `strReplace $newStr "i" ""`;
...
print $newStr;
...
// Should be "Ths s a bt of text"
...
// Replace all x's with s's
...
$newStr = `strReplace $str "x" "s"`;
...
print $newStr;
...
// Should be "This is some test"
Additional information
Related commands
...