How do I determine the type of Character?
Category: System, viewed: 8K time(s).
This example demonstrate how to define the kind of value contained in a char, whether the value is a digit, number, letter, symbol, punctuation, separator, control, whitespace or a surrogate character.
To determine the character type we can use statics method of System.Char class such as:
Char.isDigit: Any decimal digit in the range 0–9 in all Unicode locales.Char.isNumber: Any decimal digit or hexadecimal digit; this includes digits such as superscripts, subscripts, etc.Char.isLetter: Any alphabetic letter.Char.isSymbol: Any mathematical, currency, or other symbol character. Includes characters that modify surrounding characters.Char.isPunctuation: Any punctuation character.Char.isSeparator: A space separating words, a line separator, or a paragraph separator.Char.isControl: A control code in the ranges \U007F,\U0000–\U001F, and \U0080–\U009F.Char.isWhiteSpace: Any space character.Char.isSurrogate: Any surrogate character in the range \UD800–\UDFFF.
Let's see the example code below: