Project

General

Profile

$replace » History » Version 2

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

1 1 Per Amundsen
_Added in 1.8.10_
2
3
*$replace(string,substring,newstring,...)*
4
5
Replaces any occurrence of substring in string with newstring.
6
7
_[[$replace]] is case-insensitive, see [[$replacecs]] for case-sensitive 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 $replace(abcdefg,cd,xyz)
23
24
; Remove all occurrences of 'a', 'b', 'c', 'd' in the string with 'A', 'B', 'C', 'D'.
25
//echo -ag $replace(abcdefg,a,A,b,B,c,C,d,D)
26
</pre>