Project

General

Profile

$replacecs » History » Version 1

Per Amundsen, 08/10/2015 06:39 AM

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