ListSort
Sorts a delimited list and returns the result
Method Signature
Arguments
list
string
true
The list to sort
sortType
any
false
Options are text, numeric, or textnocase
sortOrder
string
false
Options are asc or desc
asc
delimiter
string
false
string the list delimiter
,
includeEmptyFields
boolean
false
boolean whether to include empty fields in the returned result
false
multiCharacterDelimiter
boolean
false
boolean whether the delimiter is multi-character
false
localeSensitive
boolean
false
Sort based on local rules
callback
any
false
Optional function to use for sorting - if the sort type is a closure, it will be recognized as a callback
Examples
Simple example for listSort function
Uses the listSort() function to get the list which sorted by type text(case-sensitive)
Result: boxlang,adobe,RAILO,Boxlang,BOXLANG
Example for listSort function with delimiters
Uses the listSort() function with delimiters to get the list which sorted by type numeric
Result: -99;10;20;46;50
Simple Example for listSort function using sortType(textnocase)
Uses the listSort() function with delimiters to get the list which sorted by type textnocase(case-insensitive)
Result: -246|10|green|ORange|RED|yeLLow
Additional Examples
Related
Last updated
Was this helpful?