$gettok » History » Version 5
Per Amundsen, 02/25/2017 04:04 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$gettok(text,N,C)* |
||
4 | |||
5 | Returns the Nth token in text. |
||
6 | |||
7 | 2 | Per Amundsen | _Same as [[$token]]._ |
8 | |||
9 | 5 | Per Amundsen | _N-N2 can be used to get a range of tokens, both numbers can be negative._ |
10 | _N- can be used to get all tokens from position N._ |
||
11 | |||
12 | 1 | Per Amundsen | *Parameters* |
13 | |||
14 | text - The text to tokenize. |
||
15 | N - The Nth token to get. |
||
16 | C - The "ASCII":http://www.asciitable.com/ value to tokenize by. |
||
17 | |||
18 | *Example* |
||
19 | |||
20 | <pre> |
||
21 | 5 | Per Amundsen | ; Print the 3rd token in 'a.b.c.d.e'. |
22 | 1 | Per Amundsen | //echo -ag $gettok(a.b.c.d.e,3,46) |
23 | 5 | Per Amundsen | |
24 | ; Print the second to forth token in 'a.b.c.d.e'. |
||
25 | //echo -ag $gettok(a.b.c.d.e,2-4,46) |
||
26 | |||
27 | ; Print all tokens from the second position. |
||
28 | //echo -ag $gettok(a.b.c.d.e,2-,46) |
||
29 | 1 | Per Amundsen | </pre> |