$sorttok

From Scriptwiki
Revision as of 21:35, 15 November 2005 by Doomie (talk | contribs)

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

Sorts the tokens in text.

$sorttok(text,C,ncra)

$sorttok sorts the tokens alphabetical as standard, though you can specify other methods, that are:

nnumeric sort
cchannel nick prefix
rreverse sort
aalphanumeric sort

Example

var %mynumbers = 1,35,3,-33,999,76,0,-1
var %mysortednumbers = $sorttok(%mynumbers,44,nr)
echo -a %mysortednumbers

This example returns 999,76,35,3,1,0,-1,-33, as it has sorted the numbers in %mynumbers numeric, beginning with the biggest (reverse).