UnicodeProperties Class
Provides the properties of a code point defined by the Unicode Character Database.
public static class UnicodePropertiesRemarks
Every method takes a code point as an Int32 and never allocates: the values are read from tables indexed by the code point. Only the methods that write to a buffer throw, when the buffer is too small. An integer that is not a code point (negative, or greater than U+10FFFF) has the default value of the property, the one of a code point the standard does not list.
The values are those of one version of the Unicode Standard, UnicodeProperties.UnicodeVersion, whatever the version the runtime implements: the results are the same on every platform and every framework version.
See also
Properties
| Name | Description |
|---|---|
| MaxCaseMappingLength | Gets the greatest number of code points a full case mapping writes for a code point. |
| UnicodeVersion | Gets the version of the Unicode Standard the properties come from. |
MaxCaseMappingLength
UnicodeProperties.csGets the greatest number of code points a full case mapping writes for a code point.
public static int MaxCaseMappingLength { get; }UnicodeVersion
UnicodeProperties.csMethods
| Name | Description |
|---|---|
| GetBidiClass(int) | Gets the Bidi_Class of a code point. |
| GetBidiPairedBracketType(int) | Gets the Bidi_Paired_Bracket_Type of a code point. |
| GetBinaryPropertyRanges(UnicodeBinaryProperty) | Gets the code points that have a binary property. |
| GetCanonicalCombiningClass(int) | Gets the Canonical_Combining_Class of a code point. |
| GetEastAsianWidth(int) | Gets the East_Asian_Width property of a code point. |
| GetGeneralCategory(int) | Gets the General_Category of a code point. |
| GetGraphemeClusterBreak(int) | Gets the Grapheme_Cluster_Break property of a code point. |
| GetIndicConjunctBreak(int) | Gets the Indic_Conjunct_Break property of a code point. |
| GetIndicPositionalCategory(int) | Gets the Indic_Positional_Category property of a code point. |
| GetIndicSyllabicCategory(int) | Gets the Indic_Syllabic_Category property of a code point. |
| GetJoiningGroup(int) | Gets the Joining_Group property of a code point. |
| GetJoiningType(int) | Gets the Joining_Type property of a code point. |
| GetLineBreakClass(int) | Gets the Line_Break property of a code point. |
| GetLowercaseMapping(int, Span<int>) | Gets the full Lowercase_Mapping of a code point, which can be several code points (İ, U+0130, → U+0069 U+0307). |
| GetSentenceBreak(int) | Gets the Sentence_Break property of a code point. |
| GetTitlecaseMapping(int, Span<int>) | Gets the full Titlecase_Mapping of a code point, which can be several code points (fi → Fi). |
| GetUppercaseMapping(int, Span<int>) | Gets the full Uppercase_Mapping of a code point, which can be several code points (ß → SS). |
| GetVerticalOrientation(int) | Gets the Vertical_Orientation property of a code point: how the character is set in a line of vertical text. |
| GetWordBreak(int) | Gets the Word_Break property of a code point. |
| HasBinaryProperty(int, UnicodeBinaryProperty) | Determines whether a code point has a binary property. |
| IsBidiMirrored(int) | Determines whether a code point has the Bidi_Mirrored property. |
| IsCaseIgnorable(int) | Determines whether a code point has the Case_Ignorable property: whether the case mappings skip it when they look at the context. |
| IsCased(int) | Determines whether a code point has the Cased property: whether it is an uppercase, a lowercase or a titlecase character. |
| IsDefaultIgnorable(int) | Determines whether a code point has the Default_Ignorable_Code_Point property. |
| IsIdContinue(int) | Determines whether a code point has the ID_Continue property: whether it can follow the first code point of an identifier. |
| IsIdStart(int) | Determines whether a code point has the ID_Start property: whether it can start an identifier. |
| IsSoftDotted(int) | Determines whether a code point has the Soft_Dotted property: whether its dot disappears when an accent is placed above it, as for i and j. |
| ToSimpleCaseFold(int) | Gets the Simple_Case_Folding of a code point: the mappings of CaseFolding.txt whose status is C or S. |
| ToSimpleLowercase(int) | Gets the Simple_Lowercase_Mapping of a code point. |
| ToSimpleTitlecase(int) | Gets the Simple_Titlecase_Mapping of a code point: the form of the code point at the start of a word. |
| ToSimpleUppercase(int) | Gets the Simple_Uppercase_Mapping of a code point. |
| TryGetBidiMirroringGlyph(int, int) | Gets the Bidi_Mirroring_Glyph of a code point. |
| TryGetBidiPairedBracket(int, int) | Gets the Bidi_Paired_Bracket of a code point. |
GetBidiClass(int)
UnicodeProperties.csGets the Bidi_Class of a code point.
public static UnicodeBidirectionalCategory GetBidiClass(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeBidirectionalCategory The bidirectional class. An unassigned code point has the default class of its range (for instance UnicodeBidirectionalCategory.RightToLeft in the Hebrew block), as the Unicode Bidirectional Algorithm requires.
See also
GetBidiPairedBracketType(int)
UnicodeProperties.csGets the Bidi_Paired_Bracket_Type of a code point.
public static UnicodeBidiPairedBracketType GetBidiPairedBracketType(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeBidiPairedBracketType Whether the code point is an opening bracket, a closing bracket or neither.
GetBinaryPropertyRanges(UnicodeBinaryProperty)
UnicodeProperties.csGets the code points that have a binary property.
public static UnicodeRange[] GetBinaryPropertyRanges(UnicodeBinaryProperty property)Parameters
propertyUnicodeBinaryProperty- The property.
Returns
UnicodeRange[] The ranges of the code points that have the property, in increasing order. The ranges neither overlap nor touch.
Exceptions
ArgumentOutOfRangeExceptionpropertyis not a value ofUnicodeBinaryProperty.
Remarks
Each call returns a new array.
GetCanonicalCombiningClass(int)
UnicodeProperties.csGetEastAsianWidth(int)
UnicodeProperties.csGets the East_Asian_Width property of a code point.
public static UnicodeEastAsianWidth GetEastAsianWidth(int codePoint)GetGeneralCategory(int)
UnicodeProperties.csGets the General_Category of a code point.
public static UnicodeCategory GetGeneralCategory(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeCategory The category; UnicodeCategory.OtherNotAssigned for an unassigned code point.
GetGraphemeClusterBreak(int)
UnicodeProperties.csGets the Grapheme_Cluster_Break property of a code point.
public static UnicodeGraphemeClusterBreak GetGraphemeClusterBreak(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeGraphemeClusterBreak The class used by the grapheme cluster boundary rules.
See also
GetIndicConjunctBreak(int)
UnicodeProperties.csGets the Indic_Conjunct_Break property of a code point.
public static UnicodeIndicConjunctBreak GetIndicConjunctBreak(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeIndicConjunctBreak The class used by the grapheme cluster rule that keeps Indic conjuncts together (GB9c).
GetIndicPositionalCategory(int)
UnicodeProperties.csGets the Indic_Positional_Category property of a code point.
public static UnicodeIndicPositionalCategory GetIndicPositionalCategory(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeIndicPositionalCategory Where a dependent vowel or another mark is placed relative to its base.
GetIndicSyllabicCategory(int)
UnicodeProperties.csGets the Indic_Syllabic_Category property of a code point.
public static UnicodeIndicSyllabicCategory GetIndicSyllabicCategory(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeIndicSyllabicCategory The role of the code point in the syllables of the Brahmi-derived scripts.
GetJoiningGroup(int)
UnicodeProperties.csGets the Joining_Group property of a code point.
public static UnicodeJoiningGroup GetJoiningGroup(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeJoiningGroup The group of letters that share the joining behavior and the basic shapes of the code point.
GetJoiningType(int)
UnicodeProperties.csGets the Joining_Type property of a code point.
public static UnicodeJoiningType GetJoiningType(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeJoiningType How the code point joins its neighbors in a cursive script such as Arabic.
GetLineBreakClass(int)
UnicodeProperties.csGets the Line_Break property of a code point.
public static UnicodeLineBreakClass GetLineBreakClass(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeLineBreakClass The class as listed by the standard, before the resolution of the Unicode Line Breaking Algorithm (rule LB1).
See also
GetLowercaseMapping(int, Span<int>)
UnicodeProperties.csGets the full Lowercase_Mapping of a code point, which can be several code points (İ, U+0130, → U+0069 U+0307).
Parameters
codePointint- The code point.
destinationSpan<int>- The buffer that receives the code points of the mapping.
Returns
int The number of code points written. It is 1, codePoint itself, when the code point has no mapping.
Exceptions
ArgumentExceptiondestinationis too small.UnicodeProperties.MaxCaseMappingLengthelements are always enough.
Remarks
The mapping is the default case conversion of the Unicode Standard (section 3.13) without its conditional mappings: the unconditional mappings of SpecialCasing.txt, else the simple mapping. The mappings that depend on the language (Turkish, Lithuanian) or on the context (the final sigma) are not applied: UnicodeCaseMapping applies them to a text.
GetSentenceBreak(int)
UnicodeProperties.csGets the Sentence_Break property of a code point.
public static UnicodeSentenceBreak GetSentenceBreak(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeSentenceBreak The class used by the sentence boundary rules.
See also
GetTitlecaseMapping(int, Span<int>)
UnicodeProperties.csGets the full Titlecase_Mapping of a code point, which can be several code points (fi → Fi).
Parameters
codePointint- The code point.
destinationSpan<int>- The buffer that receives the code points of the mapping.
Returns
int The number of code points written. It is 1, codePoint itself, when the code point has no mapping.
Exceptions
ArgumentExceptiondestinationis too small.UnicodeProperties.MaxCaseMappingLengthelements are always enough.
Remarks
The mapping is the default case conversion of the Unicode Standard (section 3.13) without its conditional mappings: the unconditional mappings of SpecialCasing.txt, else the simple mapping. The mappings that depend on the language (Turkish, Lithuanian) or on the context (the final sigma) are not applied: UnicodeCaseMapping applies them to a text.
GetUppercaseMapping(int, Span<int>)
UnicodeProperties.csGets the full Uppercase_Mapping of a code point, which can be several code points (ß → SS).
Parameters
codePointint- The code point.
destinationSpan<int>- The buffer that receives the code points of the mapping.
Returns
int The number of code points written. It is 1, codePoint itself, when the code point has no mapping.
Exceptions
ArgumentExceptiondestinationis too small.UnicodeProperties.MaxCaseMappingLengthelements are always enough.
Remarks
The mapping is the default case conversion of the Unicode Standard (section 3.13) without its conditional mappings: the unconditional mappings of SpecialCasing.txt, else the simple mapping. The mappings that depend on the language (Turkish, Lithuanian) or on the context (the final sigma) are not applied: UnicodeCaseMapping applies them to a text.
GetVerticalOrientation(int)
UnicodeProperties.csGets the Vertical_Orientation property of a code point: how the character is set in a line of vertical text.
public static UnicodeVerticalOrientation GetVerticalOrientation(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeVerticalOrientation The orientation: upright as in a horizontal line, rotated by a quarter turn clockwise, or one of the two with another glyph than in a horizontal line. A value that is not a code point is rotated, the default of the property.
See also
GetWordBreak(int)
UnicodeProperties.csGets the Word_Break property of a code point.
public static UnicodeWordBreak GetWordBreak(int codePoint)Parameters
codePointint- The code point.
Returns
UnicodeWordBreak The class used by the word boundary rules.
See also
HasBinaryProperty(int, UnicodeBinaryProperty)
UnicodeProperties.csDetermines whether a code point has a binary property.
public static bool HasBinaryProperty(int codePoint, UnicodeBinaryProperty property)Parameters
codePointint- The code point.
propertyUnicodeBinaryProperty- The property.
Returns
bool true when the code point has the property; false otherwise, and for an integer that is not a code point.
Exceptions
ArgumentOutOfRangeExceptionpropertyis not a value ofUnicodeBinaryProperty.
IsBidiMirrored(int)
UnicodeProperties.csIsCaseIgnorable(int)
UnicodeProperties.csDetermines whether a code point has the Case_Ignorable property: whether the case mappings skip it when they look at the context.
Parameters
codePointint- The code point.
Returns
bool true for the combining marks, the format characters, the modifier letters and symbols, and a few punctuation marks such as the apostrophe and the full stop.
Remarks
The property defines the context of the final sigma (The Unicode Standard, section 3.13).
IsCased(int)
UnicodeProperties.csDetermines whether a code point has the Cased property: whether it is an uppercase, a lowercase or a titlecase character.
IsDefaultIgnorable(int)
UnicodeProperties.csIsIdContinue(int)
UnicodeProperties.csDetermines whether a code point has the ID_Continue property: whether it can follow the first code point of an identifier.
IsIdStart(int)
UnicodeProperties.csIsSoftDotted(int)
UnicodeProperties.csDetermines whether a code point has the Soft_Dotted property: whether its dot disappears when an accent is placed above it, as for i and j.
ToSimpleCaseFold(int)
UnicodeProperties.csGets the Simple_Case_Folding of a code point: the mappings of CaseFolding.txt whose status is C or S.
Parameters
codePointint- The code point.
Returns
int The folded code point, or codePoint when it has no mapping.
Remarks
Two strings that differ only by case have the same simple case folding when their characters fold one to one; the full case folding (status F), which can map a code point to several ones (U+00DF to ss), is not applied. The Turkic mappings (status T) are not applied either.
ToSimpleLowercase(int)
UnicodeProperties.csGets the Simple_Lowercase_Mapping of a code point.
ToSimpleTitlecase(int)
UnicodeProperties.csGets the Simple_Titlecase_Mapping of a code point: the form of the code point at the start of a word.
Parameters
codePointint- The code point.
Returns
int The titlecase code point, or codePoint when it has no mapping. It is the UnicodeProperties.ToSimpleUppercase mapping, except for a few code points such as the Latin digraphs (dž → Dž) and the Georgian Mkhedruli letters.
Remarks
The mapping is the one-to-one, culture-independent mapping of the Unicode Character Database.
ToSimpleUppercase(int)
UnicodeProperties.csGets the Simple_Uppercase_Mapping of a code point.
TryGetBidiMirroringGlyph(int, int)
UnicodeProperties.csGets the Bidi_Mirroring_Glyph of a code point.
TryGetBidiPairedBracket(int, int)
UnicodeProperties.csGets the Bidi_Paired_Bracket of a code point.