Project

General

Profile

$reptok » History » Revision 3

Revision 2 (Per Amundsen, 08/10/2015 06:08 AM) → Revision 3/4 (Per Amundsen, 11/26/2015 06:17 PM)

_Added in 1.9.0_ 

 *$reptok(text,token,new,[N],C)* *$reptok(text,token,new,N,C)* 

 Replaces the Nth matching token in text with a new token. 

 _[[$reptok]] is case-insensitive, see [[$reptokcs]] for case-sensitive version._ 

 *Parameters* 

 text - The text to tokenize. 
 token - Token to match. 
 new - New token to replace with. 
 [N] N - If N = 0, all matching tokens, otherwise the Nth match. (Optional, default is 1) 
 C - The "ASCII":http://www.asciitable.com/ value to tokenize by. 

 *Example* 

 <pre> 
 ; Replace the first token matching 'b' with 'e' 
 //echo -ag $reptok(a.b.c.d,b,e,1,46) 

 ; Replace all tokens matching 'b' with 'e' 
 //echo -ag $reptok(b.b.b.c,b,e,0,46) 
 </pre>