Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted by ConfluenceCloudBulkEditor.py

...

Scroll tablelayout
style
sortDirectionASC
repeatTableHeadersdefault
style
widths18%, 11%, 13%, 58%
sortByColumn1
sortEnabledfalse
cellHighlightingtrue

...

Returns a new string with the old values replaced with new.

Scroll pagebreak

Examples

...

languagetext
// 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

...