# $str.token

Returns the nth token in a string

Syntax

    $str.token(<n>,<separators>,<string>)

Description

Returns the nth token inside the <string> (with n starting from 0!)
A token is a substring not containing the characters listed in <separators>.
If the string contains less than n+1 tokens then an empty string is returned.
$str.word() is an optimized function dedicated to the special case in that <separators> is a string containing all the whitespace characters.
Please note that this function is SLOW. You might want to take a look at $str.word() or even better to $split().
This function is case sensitive: you need to specify both cases in the <separators> string if you want to do a case insensitive tokenization.

Examples

        %test = "21 hours 10 minutes 15 seconds"
        echo $str.token(1," hoursmintecd",%test)

See also
$str.word() $split()

Index, Functions

KVIrc 3.2.0 Documentation
Generated by root at Thu Mar 9 08:43:54 2006