Project

General

Profile

$replacex » History » Revision 2

Revision 1 (Per Amundsen, 08/10/2015 06:41 AM) → Revision 2/3 (Per Amundsen, 08/10/2015 06:42 AM)

_Added in 1.9.0_ 

 *$replacex(string,substring,newstring,...)* 

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

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

 *Parameters* 

 string - The string to search. 
 substring - The substring to replace. 
 newstring - The new string to replace with. 
 ... - Additional substrings to replace. 

 *Example* 

 <pre> 
 ; Replace all occurrences of 'cd' in the string with 'xyz'. 
 //echo -ag $replacex(abcdefg,cd,xyz) 

 ; Remove all occurrences of 'a', 'b', 'c', 'd' in the string with 'A', 'B', 'C', 'D'. 
 //echo -ag $replacex(abcdefg,a,A,b,B,c,C,d,D) 
 </pre>