Project

General

Profile

$replacexcs » History » Version 2

Per Amundsen, 02/23/2023 07:20 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*$replacexcs(string,substring,newstring,...)*
4
5
Replaces any occurrence of substring in string with newstring except for replacements that have already been made.
6
7
_[[$replacexcs]] is case-sensitive, see [[$replacex]] for case-insensitive version._
8
9
*Parameters*
10
11 2 Per Amundsen
table(ktable).
12
|*Parameter*|*Description*|
13
| string | The string to search. |
14
| substring | The substring to replace. |
15
| newstring | The new string to replace with. |
16
| ... | Additional substrings to replace. |
17 1 Per Amundsen
18
*Example*
19
20
<pre>
21
; Replace all occurrences of 'CD' in the string with 'XYZ'.
22
//echo -ag $replacexcs(abcdCDefg,CD,XYZ)
23
24
; Remove all occurrences of 'a', 'b', 'c', 'd' in the string with 'A', 'B', 'C', 'D'.
25
//echo -ag $replacexcs(aAbBcCdDeEfFgG,a,A,b,B,c,C,d,D)
26
</pre>