Project

General

Profile

Actions

Added in 1.9.0

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

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

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

Parameters

Parameter Description
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 $replacexcs(abcdCDefg,CD,XYZ)

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

Updated by Per Amundsen almost 2 years ago · 2 revisions

Also available in: PDF HTML TXT