  | |  | sort() | sort() 2004-03-08 - By Gregg Wygonik
Back i'll assume your "list of usernames in a variable" is a delimited list... so if you want to sort the contents of the string, overwriting the unordered list, you could do something like this:
var a = "g|a|c|b|d|f|e|o|q|p|v|x|z|y"; a = a.split("|").sort().toString().split(",").join("|"); trace(a);
or - if you just want to output the values sorted, and leave the original variable un-changed:
var a = "g|a|b|c|d|e|f|o|p|q|v|x|z|y"; trace(a.split("|").sort().toString().split(",").join("\n"));
hth g.
-- --Original Message-- -- From: Simon Lord [mailto:slord@(protected)]
I now have a list of usernames in a variable that gets dumped to a field. How can I sort the names in the variable so that when they get dumped to the field they are sorted ascending from a to z?
Sincerely, Simon
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Supported by Fig Leaf Software =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Be sure to check the archives and the wiki: http://chattyfig.figleaf.com/ =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106347 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe send a blank e-mail to: Normal Mode: flashcoders-unsubscribe@(protected) Digest Mode: flashcoders-digest-unsubscrive@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |