Newer Version Available
Collator Class
Contains methods to get locale-specific instances that can be used for comparisons
and sorting. Use the getInstance() method to obtain the
Collator instance for a given locale and pass the Collator as the Comparator parameter to
the list.sort() method.
Namespace
Usage
Because locale-sensitive sorting can produce different results depending on the user running the code, avoid using it in triggers or in code that expects a particular sort order.
Example
This example performs a default list sort and then uses Collator to sort based on the user locale.
Collator Methods
The following are methods for Collator.
getInstance()
Gets the Collator instance for the current user’s locale.
Signature
public static System.Collator getInstance()
Return Value
Type: Collator Class