10[DebuggerDisplay(
"{DebuggerDisplay,nq}")]
17 14, 14, 14, 14, 14, 14, 14, 14, 14, 142,
18 142, 142, 142, 142, 14, 14, 14, 14, 14, 14,
19 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
20 14, 14, 139, 24, 24, 24, 26, 24, 24, 24,
21 20, 21, 24, 25, 24, 19, 24, 24, 72, 72,
22 72, 72, 72, 72, 72, 72, 72, 72, 24, 24,
23 25, 25, 25, 24, 24, 64, 64, 64, 64, 64,
24 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
25 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
26 64, 20, 24, 21, 27, 18, 27, 65, 65, 65,
27 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
28 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
29 65, 65, 65, 20, 25, 21, 25, 14
43 return string.Create(invariantCulture, ref handler);
70 public Rune(
char highSurrogate,
char lowSurrogate)
71 : this((uint)char.ConvertToUtf32(highSurrogate, lowSurrogate), unused: false)
90 private Rune(uint scalarValue,
bool unused)
97 return left._value == right.
_value;
102 return left._value != right.
_value;
107 return left._value < right.
_value;
112 return left._value <= right.
_value;
117 return left._value > right.
_value;
122 return left._value >= right.
_value;
125 public static explicit operator Rune(
char ch)
130 [CLSCompliant(
false)]
180 char lowSurrogate =
source[1];
181 if (
TryCreate(c, lowSurrogate, out result))
187 else if (
char.IsHighSurrogate(c))
197 charsConsumed =
source.Length;
206 if ((uint)num < (uint)
source.Length)
215 num2 = num2 - 194 << 6;
217 if ((uint)num >= (uint)
source.Length)
221 int num3 = (sbyte)
source[num];
234 if ((uint)num >= (uint)
source.Length)
238 num3 = (sbyte)
source[num];
248 if ((uint)num >= (uint)
source.Length)
252 num3 = (sbyte)
source[num];
275 bytesConsumed = num + 1;
290 int num = source.Length - 1;
291 if ((uint)num < (uint)
source.Length)
299 if (
char.IsLowSurrogate(c))
302 if ((uint)num < (uint)
source.Length)
304 char highSurrogate =
source[num];
305 if (
TryCreate(highSurrogate, c, out result))
316 charsConsumed = -source.Length >>> 31;
323 int num = source.Length - 1;
324 if ((uint)num < (uint)
source.Length)
333 if (((
byte)num2 & 0x40u) != 0)
346 if ((uint)num < (uint)
source.Length)
348 if ((sbyte)
source[num] < -64)
355 if (bytesConsumed2 ==
source.Length)
365 bytesConsumed = bytesConsumed2;
392 public override bool Equals([NotNullWhen(
true)]
object?
obj)
403 return this ==
other;
426 [CLSCompliant(
false)]
445 if (
input.Length <= 1)
449 uint num2 =
input[1];
495 return string.CreateFromChar((
char)
_value);
498 return string.CreateFromChar(highSurrogateCodePoint, lowSurrogateCodePoint);
518 result =
default(
Rune);
522 public static bool TryCreate(
char highSurrogate,
char lowSurrogate, out
Rune result)
524 uint num = (uint)(highSurrogate - 55296);
525 uint num2 = (uint)(lowSurrogate - 56320);
526 if ((num | num2) <= 1023)
528 result =
UnsafeCreate((uint)((
int)(num << 10) + (lowSurrogate - 56320) + 65536));
531 result =
default(
Rune);
540 [CLSCompliant(
false)]
548 result =
default(
Rune);
597 if ((
long)
value.Value <= 2047
L)
606 if ((
long)value.Value <= 65535
L)
645 return new Rune(scalarValue, unused:
false);
652 uint num = value._value - 48;
712 return ((
value._value + 1) & 0xFFFFFF7Fu) <= 32;
728 return ((
value._value - 65) & 0xFFFFFFDFu) <= 25;
static UnicodeCategory GetUnicodeCategory(char ch)
static double GetNumericValue(char ch)
static char ToLower(char codePoint)
static bool GetIsWhiteSpace(char ch)
static char ToUpper(char codePoint)
static CultureInfo InvariantCulture
void ChangeCaseToLower(ReadOnlySpan< char > source, Span< char > destination)
void ChangeCaseToUpper(ReadOnlySpan< char > source, Span< char > destination)
static readonly TextInfo Invariant
static string Arg_MustBeRune
static bool IsSurrogateCodePoint(uint value)
static bool IsValidUnicodeScalar(uint value)
static void GetUtf16SurrogatesFromSupplementaryPlaneScalar(uint value, out char highSurrogateCodePoint, out char lowSurrogateCodePoint)
static bool IsInRangeInclusive(uint value, uint lowerBound, uint upperBound)
static int GetUtf8SequenceLength(uint value)
static uint GetScalarFromUtf16SurrogatePair(uint highSurrogateCodePoint, uint lowSurrogateCodePoint)
static int GetUtf16SequenceLength(uint value)
static bool IsAsciiCodePoint(uint value)
static bool IsBmpCodePoint(uint value)
static bool IsHighSurrogateCodePoint(uint value)
static int GetPlane(uint codePoint)
static bool IsLowSurrogateCodePoint(uint value)
static uint ConvertAllAsciiCharsInUInt32ToLowercase(uint value)
static uint ConvertAllAsciiCharsInUInt32ToUppercase(uint value)
static void ThrowArgumentException_CannotExtractScalar(ExceptionArgument argument)
static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
static void ThrowArgumentOutOfRange_IndexException()
static void ThrowArgumentNullException(string name)
static void ThrowArgumentException_DestinationTooShort()
int CompareTo(object? obj)
void AppendLiteral(string value)
void AppendFormatted(ReadOnlySpan< char > value)
Span< T > Slice(int start)
static bool TryCreate(char highSurrogate, char lowSurrogate, out Rune result)
static bool operator>=(Rune left, Rune right)
static bool operator>(Rune left, Rune right)
override string ToString()
static bool operator<=(Rune left, Rune right)
static bool TryCreate(int value, out Rune result)
static bool IsLower(Rune value)
int CompareTo(Rune other)
static bool IsControl(Rune value)
static bool IsSeparator(Rune value)
static UnicodeCategory GetUnicodeCategoryNonAscii(Rune value)
Rune(uint scalarValue, bool unused)
static int ReadFirstRuneFromUtf16Buffer(ReadOnlySpan< char > input)
static bool IsLetter(Rune value)
static bool TryEncodeToUtf16(Rune value, Span< char > destination, out int charsWritten)
static bool IsCategoryNumber(UnicodeCategory category)
static Rune ToLowerInvariant(Rune value)
static Rune UnsafeCreate(uint scalarValue)
static OperationStatus DecodeFromUtf16(ReadOnlySpan< char > source, out Rune result, out int charsConsumed)
static bool IsValid(int value)
static bool IsLetterOrDigit(Rune value)
static bool operator!=(Rune left, Rune right)
static bool IsUpper(Rune value)
static bool IsSymbol(Rune value)
static bool IsCategoryLetterOrDecimalDigit(UnicodeCategory category)
static Rune ToLower(Rune value, CultureInfo culture)
static ReadOnlySpan< byte > AsciiCharInfo
static bool TryCreate(uint value, out Rune result)
static bool IsPunctuation(Rune value)
static bool operator<(Rune left, Rune right)
static OperationStatus DecodeFromUtf8(ReadOnlySpan< byte > source, out Rune result, out int bytesConsumed)
static bool TryEncodeToUtf8(Rune value, Span< byte > destination, out int bytesWritten)
static bool IsValid(uint value)
static bool IsCategorySymbol(UnicodeCategory category)
static bool IsWhiteSpace(Rune value)
static double GetNumericValue(Rune value)
static bool IsDigit(Rune value)
static Rune ReplacementChar
static OperationStatus DecodeLastFromUtf16(ReadOnlySpan< char > source, out Rune result, out int charsConsumed)
static Rune ToUpper(Rune value, CultureInfo culture)
static bool IsCategoryPunctuation(UnicodeCategory category)
static OperationStatus DecodeLastFromUtf8(ReadOnlySpan< byte > source, out Rune value, out int bytesConsumed)
static bool IsCategorySeparator(UnicodeCategory category)
static bool TryCreate(char ch, out Rune result)
Rune(char highSurrogate, char lowSurrogate)
override int GetHashCode()
bool TryEncodeToUtf8(Span< byte > destination, out int bytesWritten)
int EncodeToUtf8(Span< byte > destination)
static Rune ToUpperInvariant(Rune value)
static UnicodeCategory GetUnicodeCategory(Rune value)
int EncodeToUtf16(Span< char > destination)
static bool IsNumber(Rune value)
override bool Equals([NotNullWhen(true)] object? obj)
static Rune GetRuneAt(string input, int index)
static bool IsCategoryLetter(UnicodeCategory category)
static bool operator==(Rune left, Rune right)
static int ReadRuneFromString(string input, int index)
static bool TryGetRuneAt(string input, int index, out Rune value)
bool TryEncodeToUtf16(Span< char > destination, out int charsWritten)
static Rune ChangeCaseCultureAware(Rune rune, TextInfo textInfo, bool toUpper)