Project

General

Profile

Actions

$replacex » History » Revision 2

« Previous | Revision 2/3 (diff) | Next »
Per Amundsen, 08/10/2015 06:42 AM


Added in 1.9.0

$replacex(string,substring,newstring,...)

Replaces any occurrence of substring in string with newstring except for replacements that have already been made.

$replacex is case-insensitive, see $replacexcs for case-sensitive version.

Parameters

string - The string to search.
substring - The substring to replace.
newstring - The new string to replace with.
... - Additional substrings to replace.

Example

; Replace all occurrences of 'cd' in the string with 'xyz'.
//echo -ag $replacex(abcdefg,cd,xyz)

; Remove all occurrences of 'a', 'b', 'c', 'd' in the string with 'A', 'B', 'C', 'D'.
//echo -ag $replacex(abcdefg,a,A,b,B,c,C,d,D)

Updated by Per Amundsen over 8 years ago · 2 revisions

Also available in: PDF HTML TXT