Difference between revisions of "$sorttok"

From Scriptwiki
Jump to: navigation, search
 
(No difference)

Latest revision as of 22:35, 15 November 2005

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