Project

General

Profile

$token » History » Revision 2

Revision 1 (Per Amundsen, 08/10/2015 06:19 AM) → Revision 2/3 (Per Amundsen, 02/25/2017 04:05 PM)

_Added in 1.9.1_ 

 *$token(text,N,C)* 

 Returns the Nth token in text. 

 _Same as [[$gettok]]._ 

 _N-N2 can be used to get a range of tokens, both numbers can be negative._ 
 _N- can be used to get all tokens from position N._ 

 *Parameters* 

 text - The text to tokenize. 
 N - The Nth token to get. 
 C - The "ASCII":http://www.asciitable.com/ value to tokenize by. 

 *Example* 

 <pre> 
 ; Print the 3rd token in 'a.b.c.d.e' 
 //echo -ag $token(a.b.c.d.e,3,46) 

 ; Print the second to forth token in 'a.b.c.d.e'. 
 //echo -ag $token(a.b.c.d.e,2-4,46) 

 ; Print all tokens from the second position. 
 //echo -ag $token(a.b.c.d.e,2-,46) 
 </pre>