Token Identifiers

 

$addtok(text,token,C)

Adds a token to the end of text but only if it is not already in text.

 

$addtok(a.b.c,d,46)        returns a.b.c.d

$addtok(a.b.c.d,c,46)        returns a.b.c.d

 

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

 

Note: $addtokcs() is the case-sensitive version.

 

$deltok(text,N-N2,C)

Deletes the Nth token from text.

 

$deltok(a.b.c.d,3,46)        returns a.b.d

$deltok(a.b.c.d,2-3,46)        returns a.d

 

You can specify a negative value for N.

 

$findtok(text,token,N,C)

Returns the position of the Nth matching token in text.

 

$findtok(a.b.c.d,c,1,46)        returns 3

$findtok(a.b.c.d,e,1,46)        returns $null

 

If you specify zero for N, it returns the total number of matching tokens.

 

Note: $findtokcs() is the case-sensitive version.

 

$gettok(text,N,C)

Returns the Nth token in text.

 

$gettok(a.b.c.d.e,3,46)        returns c

$gettok(a.b.c.d.e,9,46)        returns $null

 

You can also specify a range of tokens:

 

$gettok(a.b.c.d.e,2-,46)        returns 2nd token onwards b.c.d.e

$gettok(a.b.c.d.e,2-4,46)        returns tokens 2 through 4 b.c.d

 

You can specify a negative value for N.

 

$instok(text,token,N,C)

Inserts token into the Nth position in text, even if it already exists in text.

 

$instok(a.b.d,c,3,46)        returns a.b.c.d

$instok(a.b.d,c,9,46)        returns a.b.d.c

 

You can specify a negative value for N.

 

$istok(text,token,C)

Returns $true if token exists, otherwise returns $false.

 

Note: $istokcs() is the case-sensitive version.

 

$matchtok(tokens,string,N,C)

Returns tokens that contain the specified string.

 

$matchtok(one two three, e, 0, 32) returns 2

$matchtok(one two three, e, 2, 32) returns three

 

If you specify zero for N, it returns the total number of matching tokens.

 

Note: $matchtokcs() is the case-sensitive version.

 

$numtok(text,C)

Returns number of tokens in text.

 

$puttok(text,token,N,C)

Overwrites the Nth token in text with a new token.

 

$puttok(a.b.c.d,e,2,46)        returns a.e.c.d

 

You can specify a negative value for N.

 

$remtok(text,token,N,C)

Removes the Nth matching token from text. If N = 0, applies to all matching items.

 

$remtok(a.b.c.d,b,1,46)        returns a.c.d

$remtok(a.b.c.d,e,1,46)        returns a.b.c.d

$remtok(a.c.c.d,c,1,46)        returns a.c.d

 

Note: $remtokcs() is the case-sensitive version.

 

$reptok(text,token,new,N,C)

Replaces the Nth matching token in text with a new token. If N = 0, applies to all matching items.

 

$reptok(a.b.c.d,b,e,1,46)        returns a.e.c.d

$reptok(a.b.c.d,f,e,1,46)        returns a.b.c.d

$reptok(a.b.a.c,a,e,2,46)        returns a.b.e.c

 

Note: $reptokcs() is the case-sensitive version.

 

$sorttok(text,C,ncra)

Sorts the tokens in text.

 

$sorttok(e.d.c.b.a,46)        returns a.b.c.d.e

$sorttok(1.3.5.2.4,46,nr)        returns 5.4.3.2.1

 

The default is an alphabetic sort, however you can specify n = numeric sort, c = channel nick prefix sort, r = reverse sort, a = alphanumeric sort.

 

Note: $sorttokcs() is the case-sensitive version.

 

$wildtok(tokens,wildstring,N,C)

Returns the Nth token that matches the wildcard string.

 

$wildtok(one two three, t*, 0, 32) returns 2

$wildtok(one two three, t*e, 1, 32) returns three

 

If you specify zero for N, it returns the total number of matching tokens.

 

Note: $wildtokcs() is the case-sensitive version.