$numtok

From Scriptwiki
Revision as of 18:17, 16 October 2005 by Doomie (talk | contribs) (typos)

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

Returns the number of tokens in a text.

$numtok(text,C)

The C parameter is the ascii value of the character separating the tokens.

Note that it's exactly the same as $gettok(text,0,C).

Example

echo -ag $numtok(This is a test,32)

This will return 4, as This is a test consists of 4 words.