$replacex » History » Version 1
  Per Amundsen, 08/10/2015 06:41 AM 
  
| 1 | 1 | Per Amundsen | _Added in 1.9.0_ | 
|---|---|---|---|
| 2 | |||
| 3 | *$replacex(string,substring,newstring,...)* | ||
| 4 | |||
| 5 | Replaces any occurrence of substring in string with newstring. | ||
| 6 | |||
| 7 | _[[$replacex]] is case-insensitive, see [[$replacexcs]] for case-sensitive 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 $replacex(abcdefg,cd,xyz) | ||
| 21 | |||
| 22 | ; Remove all occurrences of 'a', 'b', 'c', 'd' in the string with 'A', 'B', 'C', 'D'. | ||
| 23 | //echo -ag $replacex(abcdefg,a,A,b,B,c,C,d,D) | ||
| 24 | </pre> |