$sorttok
From Scriptwiki
Sorts the tokens in text.
$sorttok(text,C,ncra)
$sorttok sorts the tokens alphabetical as standard, though you can specify other methods, that are:
n | numeric sort | |
c | channel nick prefix | |
r | reverse sort | |
a | alphanumeric 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).