list class : Sort() method
Description
It sorts the caller list.
Syntax
listInstance.Sort()
Arguments
None
Return value
None
Sample code
1: | list{int} intList = new list{int}(); |
2: | intList.Add(3); |
3: | intList.Add(2); |
4: | intList.Add(1); |
5: | intList.Sort(); // Order of the list will be 1, 2, 3. |
Notes
It's a wrapper of the System.Collections.Generic.List<t>.Sort().
It will throw an exception (RtypeException) if you call this method on lists other than list{int}, list{long}, list{real}, list{bool}, or list{string}.