Project

General

Profile

Actions

Added in 1.9.0

$gettok(text,N,C)

Returns the Nth token in text.

Same as $token.

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

Parameter Description
text The text to tokenize.
N The Nth token to get.
C The ASCII value to tokenize by.

Example

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

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

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

Updated by Per Amundsen about 1 year ago · 6 revisions

Also available in: PDF HTML TXT