$deltok » History » Version 3
Per Amundsen, 02/16/2023 09:28 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$deltok(text,N-N2,C)* |
||
4 | |||
5 | Deletes the Nth token from text. |
||
6 | |||
7 | 2 | Per Amundsen | _N-N2 can be used to get a range of tokens, both numbers can be negative._ |
8 | _N- can be used to get all tokens from position N._ |
||
9 | |||
10 | 1 | Per Amundsen | *Parameters* |
11 | |||
12 | 3 | Per Amundsen | table(ktable). |
13 | |*Parameter*|*Description*| |
||
14 | | text | The text to tokenize. | |
||
15 | | N | N2 - The range of tokens or Nth token to delete. | |
||
16 | | C | The "ASCII":http://www.asciitable.com/ value to tokenize by. | |
||
17 | 1 | Per Amundsen | |
18 | *Example* |
||
19 | |||
20 | <pre> |
||
21 | ; Delete the 3rd token, result is 'a.b.d' |
||
22 | //echo -ag $deltok(a.b.c.d,3,46) |
||
23 | |||
24 | ; Delete the second to third token, result is 'a.d' |
||
25 | 2 | Per Amundsen | //echo -ag $deltok(a.b.c.d,2-3,46) |
26 | |||
27 | ; Delete all tokens from the second to end. |
||
28 | //echo -ag $deltok(a.b.c.d,2-,46) |
||
29 | 1 | Per Amundsen | </pre> |