LanguageExtensionMethods
Utility class for language and language family and language region logic.
Properties
LinguisticRegions
#public static IEnumerable<(LanguageRegion primary, LanguageRegion secondary)> LinguisticRegions { get; }
Enumerate over all linguistic geographic regions.
Methods
Create the CultureInfo object associated with the specified language. Note: there is no culture information for the ordinal language.
Parameters:
| language (Language) |
public static int StringComparison(this Language language, string a, string b, CompareOptions options = CompareOptions.None)
Compare two strings using the language rules.
Parameters:
| language (Language) | Language rules. |
| a (string) | First text. |
| b (string) | Second text. |
| options (CompareOptions = CompareOptions.None) | Options for comparison. |
Returns: Comparison key.
public static bool StringEquality(this Language language, string a, string b, CompareOptions options = CompareOptions.None)
Test two strings for equality using the language rules.
Parameters:
| language (Language) | Language rules. |
| a (string) | First text. |
| b (string) | Second text. |
| options (CompareOptions = CompareOptions.None) | Options for equality. |
Returns: True if strings are equal.
Measure the number of final characters in a string. This method will count combining characters as one.
Lower case a string.
public static Maths.IndexMap StringOrdering(this Language language, string[] keys, CompareOptions options = CompareOptions.None)
Create a sorting map for an array of strings.
Parameters:
| language (Language) | Language rules. |
| keys (string[]) | String keys to sort. This array will not be modified. |
| options (CompareOptions = CompareOptions.None) | Comparison options to use during sorting. |
Returns: Sorting map.
Upper case a string.
Gets the flag icon associated with a particular language. Not every language has a flag, either because it doesn't represent a nation state, or because it overlaps several states with competing flags.
Parameters:
| language (Language) |