AlphabeticSort
AlphabeticSort[list]
sorts the elements of list into alphabetical order.
AlphabeticSort[list,lang]
sorts using an ordering suitable for the language lang.
Details and Options
- The language can be specified by a language standard name, as used in LanguageData, or by a language entity. It can also be an alphabet specification, as used in Alphabet.
- The default language is $Language.
- The following options can be given:
-
CaseOrdering Automatic how to sort upper vs. lower case IgnoreCase False whether to ignore case for sorting IgnoreDiacritics False whether to ignore diacritics for sorting IgnorePunctuation False whether to ignore punctuation for sorting Language $Language what language or alphabet to assume - If an explicit language is specified in AlphabeticSort[…,lang], it overrides any setting for the Language option.
Examples
open allclose allBasic Examples (2)
Options (5)
CaseOrdering (2)
CaseOrdering->"LowerFirst" is the default value for most languages:
CaseOrdering->"UpperFirst" is the default value for some languages:
IgnoreCase (1)
IgnoreCase->True treats the uppercase and lowercase forms of a letter as equivalent:
IgnoreDiacritics (1)
IgnoreDiacritics->True ignores diacritic marks in the specified language:
The same words in a different language may have a different order when ignoring diacritics:
IgnorePunctuation (1)
IgnorePunctuation->True sorts after removing all punctuation marks and whitespace:
The default value of IgnorePunctuation is False:
Properties & Relations (1)
AlphabeticSort is equivalent to using Sort plus AlphabeticOrder as an ordering function:
Possible Issues (2)
In the "Turkish" language, the equivalence between lower and upper case for the letter "i" is different than in other languages:
The IgnoreCase option overrides any value CaseOrdering may have:
Neat Examples (1)
Use AlphabeticSort to get a sorted list of 2000 random words:
Text
Wolfram Research (2015), AlphabeticSort, Wolfram Language function, https://reference.wolfram.com/language/ref/AlphabeticSort.html.
CMS
Wolfram Language. 2015. "AlphabeticSort." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AlphabeticSort.html.
APA
Wolfram Language. (2015). AlphabeticSort. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AlphabeticSort.html