From Scriptwiki
Jump to: navigation, search

Sorts the tokens in text.


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

nnumeric sort
cchannel nick prefix
rreverse sort
aalphanumeric sort


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).