$gettok

From Scriptwiki
Revision as of 00:53, 12 October 2005 by Albie (talk | contribs) ($gettok page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Returns the Nth token or amount of tokens in string.

$gettok(string,N,C)

Where N is the Nth token you wish to be returned from string by delimiter C. Alternatively N can be given as 0 to return the amount of tokens in string

Example

$gettok(Ave:IT,1,58) returns Ave

This returns the first token using $chr(58) as the delimiter

$gettok(Ave:IT,0,58) returns 2

This returns the value 2 because there is two values when delimited by $chr(58)

Note: N can be a range N1-N2, Example:
$gettok(Word1 Word2 Word3 Word4,2-3,32) returns Word2 Word3