10 [__DynamicallyInvokable]
13 internal char m_value;
16 [__DynamicallyInvokable]
20 [__DynamicallyInvokable]
23 private static readonly
byte[] categoryForLatin1 =
new byte[256]
283 internal const int UNICODE_PLANE00_END = 65535;
285 internal const int UNICODE_PLANE01_START = 65536;
287 internal const int UNICODE_PLANE16_END = 1114111;
289 internal const int HIGH_SURROGATE_START = 55296;
291 internal const int LOW_SURROGATE_END = 57343;
293 private static bool IsLatin1(
char ch)
298 private static bool IsAscii(
char ch)
300 return ch <=
'\u007f';
310 [__DynamicallyInvokable]
313 return (
int)(
this | ((uint)
this << 16));
320 [__DynamicallyInvokable]
327 return this == (char)obj;
335 [__DynamicallyInvokable]
353 if (!(value is
char))
357 return this - (char)value;
363 [__DynamicallyInvokable]
371 [__DynamicallyInvokable]
388 [__DynamicallyInvokable]
391 return new string(c, 1);
400 [__DynamicallyInvokable]
419 [__DynamicallyInvokable]
420 public static bool TryParse(
string s, out
char result)
439 [__DynamicallyInvokable]
472 [__DynamicallyInvokable]
479 c = (char)(c | 0x20);
486 return CheckLetter(GetLatin1UnicodeCategory(c));
491 private static bool IsWhiteSpaceLatin1(
char c)
496 if (c !=
'\u00a0' && c !=
'\u0085')
515 [__DynamicallyInvokable]
520 return IsWhiteSpaceLatin1(c);
529 [__DynamicallyInvokable]
551 [__DynamicallyInvokable]
590 [__DynamicallyInvokable]
595 return CheckPunctuation(GetLatin1UnicodeCategory(c));
620 [__DynamicallyInvokable]
625 return CheckLetterOrDigit(GetLatin1UnicodeCategory(c));
637 [__DynamicallyInvokable]
650 [__DynamicallyInvokable]
659 [__DynamicallyInvokable]
672 [__DynamicallyInvokable]
685 [__DynamicallyInvokable]
694 [__DynamicallyInvokable]
712 [__DynamicallyInvokable]
721 [__DynamicallyInvokable]
730 [__DynamicallyInvokable]
739 [__DynamicallyInvokable]
748 [__DynamicallyInvokable]
757 [__DynamicallyInvokable]
766 [__DynamicallyInvokable]
775 [__DynamicallyInvokable]
784 [__DynamicallyInvokable]
793 [__DynamicallyInvokable]
804 [__DynamicallyInvokable]
815 [__DynamicallyInvokable]
826 [__DynamicallyInvokable]
837 [__DynamicallyInvokable]
850 [__DynamicallyInvokable]
853 return Convert.DefaultToType(
this, type, provider);
860 [__DynamicallyInvokable]
879 [__DynamicallyInvokable]
886 if ((uint)index >= (uint)s.Length)
907 [__DynamicallyInvokable]
908 public static bool IsDigit(
string s,
int index)
914 if ((uint)index >= (uint)s.Length)
939 [__DynamicallyInvokable]
946 if ((uint)index >= (uint)s.Length)
955 c = (char)(c | 0x20);
962 return CheckLetter(GetLatin1UnicodeCategory(c));
976 [__DynamicallyInvokable]
983 if ((uint)index >= (uint)s.Length)
990 return CheckLetterOrDigit(GetLatin1UnicodeCategory(ch));
1004 [__DynamicallyInvokable]
1011 if ((uint)index >= (uint)s.Length)
1026 return GetLatin1UnicodeCategory(c) ==
UnicodeCategory.LowercaseLetter;
1048 [__DynamicallyInvokable]
1061 return CheckNumber(GetLatin1UnicodeCategory(c));
1075 [__DynamicallyInvokable]
1082 if ((uint)index >= (uint)s.Length)
1097 return CheckNumber(GetLatin1UnicodeCategory(c));
1111 [__DynamicallyInvokable]
1118 if ((uint)index >= (uint)s.Length)
1125 return CheckPunctuation(GetLatin1UnicodeCategory(ch));
1143 private static bool IsSeparatorLatin1(
char c)
1147 return c ==
'\u00a0';
1156 [__DynamicallyInvokable]
1161 return IsSeparatorLatin1(c);
1175 [__DynamicallyInvokable]
1182 if ((uint)index >= (uint)s.Length)
1189 return IsSeparatorLatin1(c);
1198 [__DynamicallyInvokable]
1203 return c <=
'\udfff';
1217 [__DynamicallyInvokable]
1224 if ((uint)index >= (uint)s.Length)
1249 [__DynamicallyInvokable]
1254 return CheckSymbol(GetLatin1UnicodeCategory(c));
1268 [__DynamicallyInvokable]
1275 if ((uint)index >= (uint)s.Length)
1279 if (IsLatin1(s[index]))
1281 return CheckSymbol(GetLatin1UnicodeCategory(s[index]));
1295 [__DynamicallyInvokable]
1302 if ((uint)index >= (uint)s.Length)
1317 return GetLatin1UnicodeCategory(c) ==
UnicodeCategory.UppercaseLetter;
1331 [__DynamicallyInvokable]
1338 if ((uint)index >= (uint)s.Length)
1342 if (IsLatin1(s[index]))
1344 return IsWhiteSpaceLatin1(s[index]);
1356 return GetLatin1UnicodeCategory(c);
1375 if ((uint)index >= (uint)s.Length)
1379 if (IsLatin1(s[index]))
1381 return GetLatin1UnicodeCategory(s[index]);
1389 [__DynamicallyInvokable]
1403 [__DynamicallyInvokable]
1410 if ((uint)index >= (uint)s.Length)
1421 [__DynamicallyInvokable]
1426 return c <=
'\udbff';
1440 [__DynamicallyInvokable]
1447 if (index < 0 || index >= s.Length)
1458 [__DynamicallyInvokable]
1463 return c <=
'\udfff';
1477 [__DynamicallyInvokable]
1484 if (index < 0 || index >= s.Length)
1500 [__DynamicallyInvokable]
1507 if (index < 0 || index >= s.Length)
1511 if (index + 1 < s.Length)
1523 [__DynamicallyInvokable]
1526 if (highSurrogate >=
'\ud800' && highSurrogate <=
'\udbff')
1528 if (lowSurrogate >=
'\udc00')
1530 return lowSurrogate <=
'\udfff';
1542 [__DynamicallyInvokable]
1545 if (utf32 < 0 || utf32 > 1114111 || (utf32 >= 55296 && utf32 <= 57343))
1554 return new string(
new char[2]
1556 (char)(utf32 / 1024 + 55296),
1557 (char)(utf32 % 1024 + 56320)
1567 [__DynamicallyInvokable]
1578 return (highSurrogate - 55296) * 1024 + (lowSurrogate - 56320) + 65536;
1590 [__DynamicallyInvokable]
1597 if (index < 0 || index >= s.Length)
1601 int num = s[index] - 55296;
1602 if (num >= 0 && num <= 2047)
1606 if (index < s.Length - 1)
1608 int num2 = s[index + 1] - 56320;
1609 if (num2 >= 0 && num2 <= 1023)
1611 return num * 1024 + num2 + 65536;
float ToSingle(IFormatProvider provider)
Converts the value of this instance to an equivalent single-precision floating-point number using the...
Converts a base data type to another base data type.
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
const char MaxValue
Represents the largest possible value of a T:System.Char. This field is constant.
static bool IsLetter(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a U...
static bool IsControl(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a c...
static long ToInt64(object value)
Converts the value of the specified object to a 64-bit signed integer.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
static bool IsNumber(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a n...
static char ToLowerInvariant(char c)
Converts the value of a Unicode character to its lowercase equivalent using the casing rules of the i...
double ToDouble(IFormatProvider provider)
Converts the value of this instance to an equivalent double-precision floating-point number using the...
static bool IsLetterOrDigit(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a l...
static bool IsSymbol(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a s...
int CompareTo(char value)
Compares this instance to a specified T:System.Char object and indicates whether this instance preced...
static bool IsSurrogatePair(string s, int index)
Indicates whether two adjacent T:System.Char objects at a specified position in a string form a surro...
bool ToBoolean(IFormatProvider provider)
Converts the value of this instance to an equivalent Boolean value using the specified culture-specif...
TypeCode
Specifies the type of an object.
static int ConvertToUtf32(string s, int index)
Converts the value of a UTF-16 encoded character or surrogate pair at a specified position in a strin...
static double GetNumericValue(char c)
Converts the specified numeric Unicode character to a double-precision floating point number.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
The exception that is thrown for invalid casting or explicit conversion.
char ToChar(IFormatProvider provider)
Converts the value of this instance to an equivalent Unicode character using the specified culture-sp...
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
DateTime ToDateTime(IFormatProvider provider)
Converts the value of this instance to an equivalent T:System.DateTime using the specified culture-sp...
sbyte ToSByte(IFormatProvider provider)
Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture...
virtual TextInfo TextInfo
Gets the T:System.Globalization.TextInfo that defines the writing system associated with the culture.
static char ToUpperInvariant(char c)
Converts the value of a Unicode character to its uppercase equivalent using the casing rules of the i...
Defines a generalized type-specific comparison method that a value type or class implements to order ...
override bool Equals(object obj)
Returns a value that indicates whether this instance is equal to a specified object.
static bool IsLowSurrogate(string s, int index)
Indicates whether the T:System.Char object at the specified position in a string is a low surrogate.
static bool IsUpper(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as an ...
static bool IsUpper(char c)
Indicates whether the specified Unicode character is categorized as an uppercase letter.
static bool IsDigit(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a d...
static bool IsHighSurrogate(char c)
Indicates whether the specified T:System.Char object is a high surrogate.
override int GetHashCode()
Returns the hash code for this instance.
static char ToLower(char c, CultureInfo culture)
Converts the value of a specified Unicode character to its lowercase equivalent using specified cultu...
static char ToLower(char c)
Converts the value of a Unicode character to its lowercase equivalent.
static bool IsLetter(char c)
Indicates whether the specified Unicode character is categorized as a Unicode letter.
bool Equals(char obj)
Returns a value that indicates whether this instance is equal to the specified T:System....
Provides information about, and means to manipulate, the current environment and platform....
static UnicodeCategory GetUnicodeCategory(char ch)
Gets the Unicode category of the specified character.
decimal ToDecimal(IFormatProvider provider)
Converts the value of this instance to an equivalent T:System.Decimal number using the specified cult...
static bool IsPunctuation(char c)
Indicates whether the specified Unicode character is categorized as a punctuation mark.
int ToInt32(IFormatProvider provider)
Converts the value of this instance to an equivalent 32-bit signed integer using the specified cultur...
static bool IsLowSurrogate(char c)
Indicates whether the specified T:System.Char object is a low surrogate.
int CompareTo(object value)
Compares this instance to a specified object and indicates whether this instance precedes,...
static bool TryParse(string s, out char result)
Converts the value of the specified string to its equivalent Unicode character. A return code indicat...
static bool IsDigit(char c)
Indicates whether the specified Unicode character is categorized as a decimal digit.
virtual char ToLower(char c)
Converts the specified character to lowercase.
static char ToUpper(char c)
Converts the value of a Unicode character to its uppercase equivalent.
static ushort ToUInt16(object value)
Converts the value of the specified object to a 16-bit unsigned integer.
static bool IsSeparator(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a s...
object ToType(Type conversionType, IFormatProvider provider)
Converts the value of this instance to an T:System.Object of the specified T:System....
static sbyte ToSByte(object value)
Converts the value of the specified object to an 8-bit signed integer.
Represents type declarations: class types, interface types, array types, value types,...
ushort ToUInt16(IFormatProvider provider)
Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified cult...
static bool IsControl(char c)
Indicates whether the specified Unicode character is categorized as a control character.
static bool IsSymbol(char c)
Indicates whether the specified Unicode character is categorized as a symbol character.
static bool IsWhiteSpace(char c)
Indicates whether the specified Unicode character is categorized as white space.
static uint ToUInt32(object value)
Converts the value of the specified object to a 32-bit unsigned integer.
short ToInt16(IFormatProvider provider)
Converts the value of this instance to an equivalent 16-bit signed integer using the specified cultur...
static bool IsSurrogatePair(char highSurrogate, char lowSurrogate)
Indicates whether the two specified T:System.Char objects form a surrogate pair.
static bool IsLetterOrDigit(char c)
Indicates whether the specified Unicode character is categorized as a letter or a decimal digit.
static int ConvertToUtf32(char highSurrogate, char lowSurrogate)
Converts the value of a UTF-16 encoded surrogate pair into a Unicode code point.
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
long ToInt64(IFormatProvider provider)
Converts the value of this instance to an equivalent 64-bit signed integer using the specified cultur...
The exception that is thrown when one of the arguments provided to a method is not valid.
Retrieves information about a Unicode character. This class cannot be inherited.
TypeCode GetTypeCode()
Returns the T:System.TypeCode for value type T:System.Char.
static bool IsNumber(char c)
Indicates whether the specified Unicode character is categorized as a number.
UnicodeCategory
Defines the Unicode category of a character.
const char MinValue
Represents the smallest possible value of a T:System.Char. This field is constant.
static bool IsLower(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a l...
static double GetNumericValue(char ch)
Gets the numeric value associated with the specified character.
static bool IsPunctuation(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as a p...
static byte ToByte(object value)
Converts the value of the specified object to an 8-bit unsigned integer.
Defines a generalized method that a value type or class implements to create a type-specific method f...
static bool IsSurrogate(char c)
Indicates whether the specified character has a surrogate code unit.
static string ToString(char c)
Converts the specified Unicode character to its equivalent string representation.
static short ToInt16(object value)
Converts the value of the specified object to a 16-bit signed integer.
Specifies that the class can be serialized.
static bool IsWhiteSpace(string s, int index)
Indicates whether the character at the specified position in a specified string is categorized as whi...
override string ToString()
Converts the value of this instance to its equivalent string representation.
ulong ToUInt64(IFormatProvider provider)
Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified cult...
static char ToUpper(char c, CultureInfo culture)
Converts the value of a specified Unicode character to its uppercase equivalent using specified cultu...
static ulong ToUInt64(object value)
Converts the value of the specified object to a 64-bit unsigned integer.
static int ToInt32(object value)
Converts the value of the specified object to a 32-bit signed integer.
static UnicodeCategory GetUnicodeCategory(char c)
Categorizes a specified Unicode character into a group identified by one of the T:System....
byte ToByte(IFormatProvider provider)
Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified cultu...
static bool IsLower(char c)
Indicates whether the specified Unicode character is categorized as a lowercase letter.
Provides information about a specific culture (called a locale for unmanaged code development)....
virtual char ToUpper(char c)
Converts the specified character to uppercase.
Defines methods that convert the value of the implementing reference or value type to a common langua...
static char Parse(string s)
Converts the value of the specified string to its equivalent Unicode character.
Represents a character as a UTF-16 code unit.
static bool IsHighSurrogate(string s, int index)
Indicates whether the T:System.Char object at the specified position in a string is a high surrogate.
static bool IsSurrogate(string s, int index)
Indicates whether the character at the specified position in a specified string has a surrogate code ...
uint ToUInt32(IFormatProvider provider)
Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified cult...
static string ConvertFromUtf32(int utf32)
Converts the specified Unicode code point into a UTF-16 encoded string.
static bool IsSeparator(char c)
Indicates whether the specified Unicode character is categorized as a separator character.
string ToString(IFormatProvider provider)
Converts the value of this instance to its equivalent string representation using the specified cultu...
static double GetNumericValue(string s, int index)
Converts the numeric Unicode character at the specified position in a specified string to a double-pr...
static UnicodeCategory GetUnicodeCategory(string s, int index)
Categorizes the character at the specified position in a specified string into a group identified by ...