ListSort()
Sorts list elements according to a sort type and sort order.
ListSort( list=string, sort_type=string, sort_order=string, delimiters=string, includeEmptyFields=boolean );
Returns: String
Examples
Simple example for listSort() with type numeric,text(case-sensitive) & textnocase(case-insensitive)
listNumeric="4,-16,2,15,-5,7,11";
writeOutput(listsort(listNumeric,"numeric","asc"));
writeOutput("<br><br>");
writeOutput(listsort("Adobe/coldfusion/Lucee/15/LAS","text","desc","/"));
writeOutput("<br><br>");
writeOutput(listsort("Adobe,coldfusion,lucee,15,LAS","textnocase","asc"));
writeOutput("<br><br>");
//Member function
strList="Lucee,ColdFusion,LAS,SUSI,AdoBe";
writeDump(strlist.listSort("textnocase","asc"));
See also
- Lists
- Strings
- Sorting
- string.listSort()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)