Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Char.cs
Go to the documentation of this file.
7using System.Text;
8
9namespace System;
10
12[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
13public readonly struct Char : IComparable, IComparable<char>, IEquatable<char>, IConvertible, ISpanFormattable, IFormattable, IBinaryInteger<char>, IBinaryNumber<char>, IBitwiseOperators<char, char, char>, INumber<char>, IAdditionOperators<char, char, char>, IAdditiveIdentity<char, char>, IComparisonOperators<char, char>, IEqualityOperators<char, char>, IDecrementOperators<char>, IDivisionOperators<char, char, char>, IIncrementOperators<char>, IModulusOperators<char, char, char>, IMultiplicativeIdentity<char, char>, IMultiplyOperators<char, char, char>, ISpanParseable<char>, IParseable<char>, ISubtractionOperators<char, char, char>, IUnaryNegationOperators<char, char>, IUnaryPlusOperators<char, char>, IShiftOperators<char, char>, IMinMaxValue<char>, IUnsignedNumber<char>
14{
15 private readonly char m_value;
16
17 public const char MaxValue = '\uffff';
18
19 public const char MinValue = '\0';
20
21 private static ReadOnlySpan<byte> Latin1CharInfo => new byte[256]
22 {
23 14, 14, 14, 14, 14, 14, 14, 14, 14, 142,
24 142, 142, 142, 142, 14, 14, 14, 14, 14, 14,
25 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
26 14, 14, 139, 24, 24, 24, 26, 24, 24, 24,
27 20, 21, 24, 25, 24, 19, 24, 24, 8, 8,
28 8, 8, 8, 8, 8, 8, 8, 8, 24, 24,
29 25, 25, 25, 24, 24, 64, 64, 64, 64, 64,
30 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
31 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
32 64, 20, 24, 21, 27, 18, 27, 33, 33, 33,
33 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
34 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
35 33, 33, 33, 20, 25, 21, 25, 14, 14, 14,
36 14, 14, 14, 142, 14, 14, 14, 14, 14, 14,
37 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
38 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
39 139, 24, 26, 26, 26, 26, 28, 24, 27, 28,
40 4, 22, 25, 15, 28, 27, 28, 25, 10, 10,
41 27, 33, 24, 24, 27, 10, 4, 23, 10, 10,
42 10, 24, 64, 64, 64, 64, 64, 64, 64, 64,
43 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
44 64, 64, 64, 64, 64, 25, 64, 64, 64, 64,
45 64, 64, 64, 33, 33, 33, 33, 33, 33, 33,
46 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
47 33, 33, 33, 33, 33, 33, 33, 25, 33, 33,
48 33, 33, 33, 33, 33, 33
49 };
50
51 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
53
54 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
55 static char IMinMaxValue<char>.MinValue => '\0';
56
57 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
58 static char IMinMaxValue<char>.MaxValue => '\uffff';
59
60 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
62
63 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
64 static char INumber<char>.One => '\u0001';
65
66 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
67 static char INumber<char>.Zero => '\0';
68
69 private static bool IsLatin1(char c)
70 {
71 return (uint)c < (uint)Latin1CharInfo.Length;
72 }
73
74 public static bool IsAscii(char c)
75 {
76 return (uint)c <= 127u;
77 }
78
80 {
81 return (UnicodeCategory)(Latin1CharInfo[c] & 0x1F);
82 }
83
84 public override int GetHashCode()
85 {
86 return (int)(this | ((uint)this << 16));
87 }
88
89 public override bool Equals([NotNullWhen(true)] object? obj)
90 {
91 if (!(obj is char))
92 {
93 return false;
94 }
95 return this == (char)obj;
96 }
97
98 [NonVersionable]
99 public bool Equals(char obj)
100 {
101 return this == obj;
102 }
103
104 public int CompareTo(object? value)
105 {
106 if (value == null)
107 {
108 return 1;
109 }
110 if (!(value is char))
111 {
113 }
114 return this - (char)value;
115 }
116
117 public int CompareTo(char value)
118 {
119 return this - value;
120 }
121
122 public override string ToString()
123 {
124 return ToString(this);
125 }
126
127 public string ToString(IFormatProvider? provider)
128 {
129 return ToString(this);
130 }
131
132 public static string ToString(char c)
133 {
134 return string.CreateFromChar(c);
135 }
136
138 {
139 if (!destination.IsEmpty)
140 {
141 destination[0] = this;
142 charsWritten = 1;
143 return true;
144 }
145 charsWritten = 0;
146 return false;
147 }
148
149 string IFormattable.ToString(string format, IFormatProvider formatProvider)
150 {
151 return ToString(this);
152 }
153
154 public static char Parse(string s)
155 {
156 if (s == null)
157 {
159 }
160 if (s.Length != 1)
161 {
163 }
164 return s[0];
165 }
166
167 public static bool TryParse([NotNullWhen(true)] string? s, out char result)
168 {
169 result = '\0';
170 if (s == null)
171 {
172 return false;
173 }
174 if (s.Length != 1)
175 {
176 return false;
177 }
178 result = s[0];
179 return true;
180 }
181
182 public static bool IsDigit(char c)
183 {
184 if (IsLatin1(c))
185 {
186 return IsInRange(c, '0', '9');
187 }
188 return CharUnicodeInfo.GetUnicodeCategory(c) == UnicodeCategory.DecimalDigitNumber;
189 }
190
191 internal static bool IsInRange(char c, char min, char max)
192 {
193 return (uint)(c - min) <= (uint)(max - min);
194 }
195
197 {
198 return (uint)(c - min) <= (uint)(max - min);
199 }
200
201 internal static bool CheckLetter(UnicodeCategory uc)
202 {
203 return IsInRange(uc, UnicodeCategory.UppercaseLetter, UnicodeCategory.OtherLetter);
204 }
205
206 public static bool IsLetter(char c)
207 {
208 if (IsAscii(c))
209 {
210 return (Latin1CharInfo[c] & 0x60) != 0;
211 }
213 }
214
215 private static bool IsWhiteSpaceLatin1(char c)
216 {
217 return (Latin1CharInfo[c] & 0x80) != 0;
218 }
219
220 public static bool IsWhiteSpace(char c)
221 {
222 if (IsLatin1(c))
223 {
224 return IsWhiteSpaceLatin1(c);
225 }
227 }
228
229 public static bool IsUpper(char c)
230 {
231 if (IsLatin1(c))
232 {
233 return (Latin1CharInfo[c] & 0x40) != 0;
234 }
235 return CharUnicodeInfo.GetUnicodeCategory(c) == UnicodeCategory.UppercaseLetter;
236 }
237
238 public static bool IsLower(char c)
239 {
240 if (IsLatin1(c))
241 {
242 return (Latin1CharInfo[c] & 0x20) != 0;
243 }
244 return CharUnicodeInfo.GetUnicodeCategory(c) == UnicodeCategory.LowercaseLetter;
245 }
246
247 internal static bool CheckPunctuation(UnicodeCategory uc)
248 {
249 return IsInRange(uc, UnicodeCategory.ConnectorPunctuation, UnicodeCategory.OtherPunctuation);
250 }
251
252 public static bool IsPunctuation(char c)
253 {
254 if (IsLatin1(c))
255 {
257 }
259 }
260
261 internal static bool CheckLetterOrDigit(UnicodeCategory uc)
262 {
263 if (!CheckLetter(uc))
264 {
265 return uc == UnicodeCategory.DecimalDigitNumber;
266 }
267 return true;
268 }
269
270 public static bool IsLetterOrDigit(char c)
271 {
272 if (IsLatin1(c))
273 {
275 }
277 }
278
279 public static char ToUpper(char c, CultureInfo culture)
280 {
281 if (culture == null)
282 {
284 }
285 return culture.TextInfo.ToUpper(c);
286 }
287
288 public static char ToUpper(char c)
289 {
290 return CultureInfo.CurrentCulture.TextInfo.ToUpper(c);
291 }
292
293 public static char ToUpperInvariant(char c)
294 {
295 return TextInfo.ToUpperInvariant(c);
296 }
297
298 public static char ToLower(char c, CultureInfo culture)
299 {
300 if (culture == null)
301 {
303 }
304 return culture.TextInfo.ToLower(c);
305 }
306
307 public static char ToLower(char c)
308 {
309 return CultureInfo.CurrentCulture.TextInfo.ToLower(c);
310 }
311
312 public static char ToLowerInvariant(char c)
313 {
314 return TextInfo.ToLowerInvariant(c);
315 }
316
318 {
319 return TypeCode.Char;
320 }
321
323 {
324 throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Boolean"));
325 }
326
328 {
329 return this;
330 }
331
333 {
334 return Convert.ToSByte(this);
335 }
336
338 {
339 return Convert.ToByte(this);
340 }
341
343 {
344 return Convert.ToInt16(this);
345 }
346
348 {
349 return Convert.ToUInt16(this);
350 }
351
353 {
354 return Convert.ToInt32(this);
355 }
356
358 {
359 return Convert.ToUInt32(this);
360 }
361
363 {
364 return Convert.ToInt64(this);
365 }
366
368 {
369 return Convert.ToUInt64(this);
370 }
371
373 {
374 throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Single"));
375 }
376
378 {
379 throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Double"));
380 }
381
383 {
384 throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Decimal"));
385 }
386
388 {
389 throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "DateTime"));
390 }
391
393 {
394 return Convert.DefaultToType(this, type, provider);
395 }
396
397 public static bool IsControl(char c)
398 {
399 return (uint)((c + 1) & -129) <= 32u;
400 }
401
402 public static bool IsControl(string s, int index)
403 {
404 if (s == null)
405 {
407 }
408 if ((uint)index >= (uint)s.Length)
409 {
411 }
412 return IsControl(s[index]);
413 }
414
415 public static bool IsDigit(string s, int index)
416 {
417 if (s == null)
418 {
420 }
421 if ((uint)index >= (uint)s.Length)
422 {
424 }
425 char c = s[index];
426 if (IsLatin1(c))
427 {
428 return IsInRange(c, '0', '9');
429 }
431 }
432
433 public static bool IsLetter(string s, int index)
434 {
435 if (s == null)
436 {
438 }
439 if ((uint)index >= (uint)s.Length)
440 {
442 }
443 char c = s[index];
444 if (IsAscii(c))
445 {
446 return (Latin1CharInfo[c] & 0x60) != 0;
447 }
449 }
450
451 public static bool IsLetterOrDigit(string s, int index)
452 {
453 if (s == null)
454 {
456 }
457 if ((uint)index >= (uint)s.Length)
458 {
460 }
461 char c = s[index];
462 if (IsLatin1(c))
463 {
465 }
467 }
468
469 public static bool IsLower(string s, int index)
470 {
471 if (s == null)
472 {
474 }
475 if ((uint)index >= (uint)s.Length)
476 {
478 }
479 char c = s[index];
480 if (IsLatin1(c))
481 {
482 return (Latin1CharInfo[c] & 0x20) != 0;
483 }
485 }
486
487 internal static bool CheckNumber(UnicodeCategory uc)
488 {
489 return IsInRange(uc, UnicodeCategory.DecimalDigitNumber, UnicodeCategory.OtherNumber);
490 }
491
492 public static bool IsNumber(char c)
493 {
494 if (IsLatin1(c))
495 {
496 if (IsAscii(c))
497 {
498 return IsInRange(c, '0', '9');
499 }
501 }
503 }
504
505 public static bool IsNumber(string s, int index)
506 {
507 if (s == null)
508 {
510 }
511 if ((uint)index >= (uint)s.Length)
512 {
514 }
515 char c = s[index];
516 if (IsLatin1(c))
517 {
518 if (IsAscii(c))
519 {
520 return IsInRange(c, '0', '9');
521 }
523 }
525 }
526
527 public static bool IsPunctuation(string s, int index)
528 {
529 if (s == null)
530 {
532 }
533 if ((uint)index >= (uint)s.Length)
534 {
536 }
537 char c = s[index];
538 if (IsLatin1(c))
539 {
541 }
543 }
544
545 internal static bool CheckSeparator(UnicodeCategory uc)
546 {
547 return IsInRange(uc, UnicodeCategory.SpaceSeparator, UnicodeCategory.ParagraphSeparator);
548 }
549
550 private static bool IsSeparatorLatin1(char c)
551 {
552 if (c != ' ')
553 {
554 return c == '\u00a0';
555 }
556 return true;
557 }
558
559 public static bool IsSeparator(char c)
560 {
561 if (IsLatin1(c))
562 {
563 return IsSeparatorLatin1(c);
564 }
566 }
567
568 public static bool IsSeparator(string s, int index)
569 {
570 if (s == null)
571 {
573 }
574 if ((uint)index >= (uint)s.Length)
575 {
577 }
578 char c = s[index];
579 if (IsLatin1(c))
580 {
581 return IsSeparatorLatin1(c);
582 }
584 }
585
586 public static bool IsSurrogate(char c)
587 {
588 return IsInRange(c, '\ud800', '\udfff');
589 }
590
591 public static bool IsSurrogate(string s, int index)
592 {
593 if (s == null)
594 {
596 }
597 if ((uint)index >= (uint)s.Length)
598 {
600 }
601 return IsSurrogate(s[index]);
602 }
603
604 internal static bool CheckSymbol(UnicodeCategory uc)
605 {
606 return IsInRange(uc, UnicodeCategory.MathSymbol, UnicodeCategory.OtherSymbol);
607 }
608
609 public static bool IsSymbol(char c)
610 {
611 if (IsLatin1(c))
612 {
614 }
616 }
617
618 public static bool IsSymbol(string s, int index)
619 {
620 if (s == null)
621 {
623 }
624 if ((uint)index >= (uint)s.Length)
625 {
627 }
628 char c = s[index];
629 if (IsLatin1(c))
630 {
632 }
634 }
635
636 public static bool IsUpper(string s, int index)
637 {
638 if (s == null)
639 {
641 }
642 if ((uint)index >= (uint)s.Length)
643 {
645 }
646 char c = s[index];
647 if (IsLatin1(c))
648 {
649 return (Latin1CharInfo[c] & 0x40) != 0;
650 }
652 }
653
654 public static bool IsWhiteSpace(string s, int index)
655 {
656 if (s == null)
657 {
659 }
660 if ((uint)index >= (uint)s.Length)
661 {
663 }
664 return IsWhiteSpace(s[index]);
665 }
666
668 {
669 if (IsLatin1(c))
670 {
671 return GetLatin1UnicodeCategory(c);
672 }
673 return CharUnicodeInfo.GetUnicodeCategory((int)c);
674 }
675
676 public static UnicodeCategory GetUnicodeCategory(string s, int index)
677 {
678 if (s == null)
679 {
681 }
682 if ((uint)index >= (uint)s.Length)
683 {
685 }
686 if (IsLatin1(s[index]))
687 {
689 }
691 }
692
693 public static double GetNumericValue(char c)
694 {
696 }
697
698 public static double GetNumericValue(string s, int index)
699 {
700 if (s == null)
701 {
703 }
704 if ((uint)index >= (uint)s.Length)
705 {
707 }
709 }
710
711 public static bool IsHighSurrogate(char c)
712 {
713 return IsInRange(c, '\ud800', '\udbff');
714 }
715
716 public static bool IsHighSurrogate(string s, int index)
717 {
718 if (s == null)
719 {
721 }
722 if ((uint)index >= (uint)s.Length)
723 {
725 }
726 return IsHighSurrogate(s[index]);
727 }
728
729 public static bool IsLowSurrogate(char c)
730 {
731 return IsInRange(c, '\udc00', '\udfff');
732 }
733
734 public static bool IsLowSurrogate(string s, int index)
735 {
736 if (s == null)
737 {
739 }
740 if ((uint)index >= (uint)s.Length)
741 {
743 }
744 return IsLowSurrogate(s[index]);
745 }
746
747 public static bool IsSurrogatePair(string s, int index)
748 {
749 if (s == null)
750 {
752 }
753 if ((uint)index >= (uint)s.Length)
754 {
756 }
757 if (index + 1 < s.Length)
758 {
759 return IsSurrogatePair(s[index], s[index + 1]);
760 }
761 return false;
762 }
763
764 public static bool IsSurrogatePair(char highSurrogate, char lowSurrogate)
765 {
766 uint num = (uint)(highSurrogate - 55296);
767 uint num2 = (uint)(lowSurrogate - 56320);
768 return (num | num2) <= 1023;
769 }
770
771 public static string ConvertFromUtf32(int utf32)
772 {
773 if (!UnicodeUtility.IsValidUnicodeScalar((uint)utf32))
774 {
776 }
777 return Rune.UnsafeCreate((uint)utf32).ToString();
778 }
779
780 public static int ConvertToUtf32(char highSurrogate, char lowSurrogate)
781 {
782 uint num = (uint)(highSurrogate - 55296);
783 uint num2 = (uint)(lowSurrogate - 56320);
784 if ((num | num2) > 1023)
785 {
787 }
788 return (int)(num << 10) + (lowSurrogate - 56320) + 65536;
789 }
790
791 [StackTraceHidden]
792 private static void ConvertToUtf32_ThrowInvalidArgs(uint highSurrogateOffset)
793 {
794 if (highSurrogateOffset > 1023)
795 {
797 }
799 }
800
801 public static int ConvertToUtf32(string s, int index)
802 {
803 if (s == null)
804 {
806 }
807 if (index < 0 || index >= s.Length)
808 {
810 }
811 int num = s[index] - 55296;
812 if (num >= 0 && num <= 2047)
813 {
814 if (num <= 1023)
815 {
816 if (index < s.Length - 1)
817 {
818 int num2 = s[index + 1] - 56320;
819 if (num2 >= 0 && num2 <= 1023)
820 {
821 return num * 1024 + num2 + 65536;
822 }
824 }
826 }
828 }
829 return s[index];
830 }
831
832 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
833 static char IAdditionOperators<char, char, char>.operator +(char left, char right)
834 {
835 return (char)(left + right);
836 }
837
838 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
840 {
841 return (char)(BitOperations.LeadingZeroCount(value) - 16);
842 }
843
844 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
846 {
847 return (char)BitOperations.PopCount(value);
848 }
849
850 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
851 static char IBinaryInteger<char>.RotateLeft(char value, int rotateAmount)
852 {
853 return (char)(((uint)value << (rotateAmount & 0xF)) | (uint)((int)value >> ((16 - rotateAmount) & 0xF)));
854 }
855
856 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
857 static char IBinaryInteger<char>.RotateRight(char value, int rotateAmount)
858 {
859 return (char)((uint)((int)value >> (rotateAmount & 0xF)) | ((uint)value << ((16 - rotateAmount) & 0xF)));
860 }
861
862 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
864 {
865 return (char)(BitOperations.TrailingZeroCount((int)((uint)value << 16)) - 16);
866 }
867
868 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
870 {
871 return BitOperations.IsPow2((uint)value);
872 }
873
874 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
876 {
877 return (char)BitOperations.Log2(value);
878 }
879
880 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
881 static char IBitwiseOperators<char, char, char>.operator &(char left, char right)
882 {
883 return (char)(left & right);
884 }
885
886 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
887 static char IBitwiseOperators<char, char, char>.operator |(char left, char right)
888 {
889 return (char)(left | right);
890 }
891
892 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
893 static char IBitwiseOperators<char, char, char>.operator ^(char left, char right)
894 {
895 return (char)(left ^ right);
896 }
897
898 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
899 static char IBitwiseOperators<char, char, char>.operator ~(char value)
900 {
901 return (char)(~(uint)value);
902 }
903
904 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
905 static bool IComparisonOperators<char, char>.operator <(char left, char right)
906 {
907 return left < right;
908 }
909
910 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
911 static bool IComparisonOperators<char, char>.operator <=(char left, char right)
912 {
913 return left <= right;
914 }
915
916 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
917 static bool IComparisonOperators<char, char>.operator >(char left, char right)
918 {
919 return left > right;
920 }
921
922 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
923 static bool IComparisonOperators<char, char>.operator >=(char left, char right)
924 {
925 return left >= right;
926 }
927
928 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
929 static char IDecrementOperators<char>.operator --(char value)
930 {
931 return value = (char)(value - 1);
932 }
933
934 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
935 static char IDivisionOperators<char, char, char>.operator /(char left, char right)
936 {
937 return (char)(left / right);
938 }
939
940 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
941 static bool IEqualityOperators<char, char>.operator ==(char left, char right)
942 {
943 return left == right;
944 }
945
946 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
947 static bool IEqualityOperators<char, char>.operator !=(char left, char right)
948 {
949 return left != right;
950 }
951
952 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
953 static char IIncrementOperators<char>.operator ++(char value)
954 {
955 return value = (char)(value + 1);
956 }
957
958 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
959 static char IModulusOperators<char, char, char>.operator %(char left, char right)
960 {
961 return (char)(left % right);
962 }
963
964 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
965 static char IMultiplyOperators<char, char, char>.operator *(char left, char right)
966 {
967 return (char)(left * right);
968 }
969
970 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
971 static char INumber<char>.Abs(char value)
972 {
973 return value;
974 }
975
976 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
977 static char INumber<char>.Clamp(char value, char min, char max)
978 {
979 return (char)Math.Clamp(value, min, max);
980 }
981
982 [MethodImpl(MethodImplOptions.AggressiveInlining)]
983 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
984 static char INumber<char>.Create<TOther>(TOther value)
985 {
986 if (typeof(TOther) == typeof(byte))
987 {
988 return (char)(byte)(object)value;
989 }
990 if (typeof(TOther) == typeof(char))
991 {
992 return (char)(object)value;
993 }
994 if (typeof(TOther) == typeof(decimal))
995 {
996 return (char)(decimal)(object)value;
997 }
998 if (typeof(TOther) == typeof(double))
999 {
1000 return (char)checked((ushort)(double)(object)value);
1001 }
1002 if (typeof(TOther) == typeof(short))
1003 {
1004 return (char)checked((ushort)(short)(object)value);
1005 }
1006 if (typeof(TOther) == typeof(int))
1007 {
1008 return (char)checked((ushort)(int)(object)value);
1009 }
1010 if (typeof(TOther) == typeof(long))
1011 {
1012 return (char)checked((ushort)(long)(object)value);
1013 }
1014 if (typeof(TOther) == typeof(IntPtr))
1015 {
1016 return (char)checked((ushort)(nint)(IntPtr)(object)value);
1017 }
1018 if (typeof(TOther) == typeof(sbyte))
1019 {
1020 return (char)checked((ushort)(sbyte)(object)value);
1021 }
1022 if (typeof(TOther) == typeof(float))
1023 {
1024 return (char)checked((ushort)(float)(object)value);
1025 }
1026 if (typeof(TOther) == typeof(ushort))
1027 {
1028 return (char)(ushort)(object)value;
1029 }
1030 if (typeof(TOther) == typeof(uint))
1031 {
1032 return (char)checked((ushort)(uint)(object)value);
1033 }
1034 if (typeof(TOther) == typeof(ulong))
1035 {
1036 return (char)checked((ushort)(ulong)(object)value);
1037 }
1038 if (typeof(TOther) == typeof(UIntPtr))
1039 {
1040 return (char)checked((ushort)(nuint)(UIntPtr)(object)value);
1041 }
1043 return '\0';
1044 }
1045
1046 [MethodImpl(MethodImplOptions.AggressiveInlining)]
1047 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1048 static char INumber<char>.CreateSaturating<TOther>(TOther value)
1049 {
1050 if (typeof(TOther) == typeof(byte))
1051 {
1052 return (char)(byte)(object)value;
1053 }
1054 if (typeof(TOther) == typeof(char))
1055 {
1056 return (char)(object)value;
1057 }
1058 if (typeof(TOther) == typeof(decimal))
1059 {
1060 decimal num = (decimal)(object)value;
1061 if (!(num > 65535m))
1062 {
1063 if (!(num < 0m))
1064 {
1065 return (char)num;
1066 }
1067 return '\0';
1068 }
1069 return '\uffff';
1070 }
1071 if (typeof(TOther) == typeof(double))
1072 {
1073 double num2 = (double)(object)value;
1074 if (!(num2 > 65535.0))
1075 {
1076 if (!(num2 < 0.0))
1077 {
1078 return (char)num2;
1079 }
1080 return '\0';
1081 }
1082 return '\uffff';
1083 }
1084 if (typeof(TOther) == typeof(short))
1085 {
1086 short num3 = (short)(object)value;
1087 if (num3 >= 0)
1088 {
1089 return (char)num3;
1090 }
1091 return '\0';
1092 }
1093 if (typeof(TOther) == typeof(int))
1094 {
1095 int num4 = (int)(object)value;
1096 if (num4 <= 65535)
1097 {
1098 if (num4 >= 0)
1099 {
1100 return (char)num4;
1101 }
1102 return '\0';
1103 }
1104 return '\uffff';
1105 }
1106 if (typeof(TOther) == typeof(long))
1107 {
1108 long num5 = (long)(object)value;
1109 if (num5 <= 65535)
1110 {
1111 if (num5 >= 0)
1112 {
1113 return (char)num5;
1114 }
1115 return '\0';
1116 }
1117 return '\uffff';
1118 }
1119 if (typeof(TOther) == typeof(IntPtr))
1120 {
1121 IntPtr intPtr = (IntPtr)(object)value;
1122 if ((nint)intPtr <= 65535)
1123 {
1124 if ((nint)intPtr >= 0)
1125 {
1126 return (char)(nint)intPtr;
1127 }
1128 return '\0';
1129 }
1130 return '\uffff';
1131 }
1132 if (typeof(TOther) == typeof(sbyte))
1133 {
1134 sbyte b = (sbyte)(object)value;
1135 if (b >= 0)
1136 {
1137 return (char)b;
1138 }
1139 return '\0';
1140 }
1141 if (typeof(TOther) == typeof(float))
1142 {
1143 float num6 = (float)(object)value;
1144 if (!(num6 > 65535f))
1145 {
1146 if (!(num6 < 0f))
1147 {
1148 return (char)num6;
1149 }
1150 return '\0';
1151 }
1152 return '\uffff';
1153 }
1154 if (typeof(TOther) == typeof(ushort))
1155 {
1156 return (char)(ushort)(object)value;
1157 }
1158 if (typeof(TOther) == typeof(uint))
1159 {
1160 uint num7 = (uint)(object)value;
1161 if (num7 <= 65535)
1162 {
1163 return (char)num7;
1164 }
1165 return '\uffff';
1166 }
1167 if (typeof(TOther) == typeof(ulong))
1168 {
1169 ulong num8 = (ulong)(object)value;
1170 if (num8 <= 65535)
1171 {
1172 return (char)num8;
1173 }
1174 return '\uffff';
1175 }
1176 if (typeof(TOther) == typeof(UIntPtr))
1177 {
1178 UIntPtr uIntPtr = (UIntPtr)(object)value;
1179 if ((nuint)uIntPtr <= 65535)
1180 {
1181 return (char)(nuint)uIntPtr;
1182 }
1183 return '\uffff';
1184 }
1186 return '\0';
1187 }
1188
1189 [MethodImpl(MethodImplOptions.AggressiveInlining)]
1190 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1191 static char INumber<char>.CreateTruncating<TOther>(TOther value)
1192 {
1193 if (typeof(TOther) == typeof(byte))
1194 {
1195 return (char)(byte)(object)value;
1196 }
1197 if (typeof(TOther) == typeof(char))
1198 {
1199 return (char)(object)value;
1200 }
1201 if (typeof(TOther) == typeof(decimal))
1202 {
1203 return (char)(decimal)(object)value;
1204 }
1205 if (typeof(TOther) == typeof(double))
1206 {
1207 return (char)(double)(object)value;
1208 }
1209 if (typeof(TOther) == typeof(short))
1210 {
1211 return (char)(short)(object)value;
1212 }
1213 if (typeof(TOther) == typeof(int))
1214 {
1215 return (char)(int)(object)value;
1216 }
1217 if (typeof(TOther) == typeof(long))
1218 {
1219 return (char)(long)(object)value;
1220 }
1221 if (typeof(TOther) == typeof(IntPtr))
1222 {
1223 return (char)(nint)(IntPtr)(object)value;
1224 }
1225 if (typeof(TOther) == typeof(sbyte))
1226 {
1227 return (char)(sbyte)(object)value;
1228 }
1229 if (typeof(TOther) == typeof(float))
1230 {
1231 return (char)(float)(object)value;
1232 }
1233 if (typeof(TOther) == typeof(ushort))
1234 {
1235 return (char)(ushort)(object)value;
1236 }
1237 if (typeof(TOther) == typeof(uint))
1238 {
1239 return (char)(uint)(object)value;
1240 }
1241 if (typeof(TOther) == typeof(ulong))
1242 {
1243 return (char)(ulong)(object)value;
1244 }
1245 if (typeof(TOther) == typeof(UIntPtr))
1246 {
1247 return (char)(nuint)(UIntPtr)(object)value;
1248 }
1250 return '\0';
1251 }
1252
1253 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1254 static (char Quotient, char Remainder) INumber<char>.DivRem(char left, char right)
1255 {
1256 (ushort, ushort) tuple = Math.DivRem(left, right);
1257 return (Quotient: (char)tuple.Item1, Remainder: (char)tuple.Item2);
1258 }
1259
1260 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1261 static char INumber<char>.Max(char x, char y)
1262 {
1263 return (char)Math.Max(x, y);
1264 }
1265
1266 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1267 static char INumber<char>.Min(char x, char y)
1268 {
1269 return (char)Math.Min(x, y);
1270 }
1271
1272 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1273 static char INumber<char>.Parse(string s, NumberStyles style, IFormatProvider provider)
1274 {
1275 return Parse(s);
1276 }
1277
1278 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1280 {
1281 if (s.Length != 1)
1282 {
1284 }
1285 return s[0];
1286 }
1287
1288 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1289 static char INumber<char>.Sign(char value)
1290 {
1291 return (char)((value != 0) ? 1u : 0u);
1292 }
1293
1294 [MethodImpl(MethodImplOptions.AggressiveInlining)]
1295 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1296 static bool INumber<char>.TryCreate<TOther>(TOther value, out char result)
1297 {
1298 if (typeof(TOther) == typeof(byte))
1299 {
1300 result = (char)(byte)(object)value;
1301 return true;
1302 }
1303 if (typeof(TOther) == typeof(char))
1304 {
1305 result = (char)(object)value;
1306 return true;
1307 }
1308 if (typeof(TOther) == typeof(decimal))
1309 {
1310 decimal num = (decimal)(object)value;
1311 if (num < 0m || num > 65535m)
1312 {
1313 result = '\0';
1314 return false;
1315 }
1316 result = (char)num;
1317 return true;
1318 }
1319 if (typeof(TOther) == typeof(double))
1320 {
1321 double num2 = (double)(object)value;
1322 if (num2 < 0.0 || num2 > 65535.0)
1323 {
1324 result = '\0';
1325 return false;
1326 }
1327 result = (char)num2;
1328 return true;
1329 }
1330 if (typeof(TOther) == typeof(short))
1331 {
1332 short num3 = (short)(object)value;
1333 if (num3 < 0)
1334 {
1335 result = '\0';
1336 return false;
1337 }
1338 result = (char)num3;
1339 return true;
1340 }
1341 if (typeof(TOther) == typeof(int))
1342 {
1343 int num4 = (int)(object)value;
1344 if (num4 < 0 || num4 > 65535)
1345 {
1346 result = '\0';
1347 return false;
1348 }
1349 result = (char)num4;
1350 return true;
1351 }
1352 if (typeof(TOther) == typeof(long))
1353 {
1354 long num5 = (long)(object)value;
1355 if (num5 < 0 || num5 > 65535)
1356 {
1357 result = '\0';
1358 return false;
1359 }
1360 result = (char)num5;
1361 return true;
1362 }
1363 if (typeof(TOther) == typeof(IntPtr))
1364 {
1365 IntPtr intPtr = (IntPtr)(object)value;
1366 if ((nint)intPtr < 0 || (nint)intPtr > 65535)
1367 {
1368 result = '\0';
1369 return false;
1370 }
1371 result = (char)(nint)intPtr;
1372 return true;
1373 }
1374 if (typeof(TOther) == typeof(sbyte))
1375 {
1376 sbyte b = (sbyte)(object)value;
1377 if (b < 0)
1378 {
1379 result = '\0';
1380 return false;
1381 }
1382 result = (char)b;
1383 return true;
1384 }
1385 if (typeof(TOther) == typeof(float))
1386 {
1387 float num6 = (float)(object)value;
1388 if (num6 < 0f || num6 > 65535f)
1389 {
1390 result = '\0';
1391 return false;
1392 }
1393 result = (char)num6;
1394 return true;
1395 }
1396 if (typeof(TOther) == typeof(ushort))
1397 {
1398 ushort num7 = (ushort)(object)value;
1399 if (num7 > ushort.MaxValue)
1400 {
1401 result = '\0';
1402 return false;
1403 }
1404 result = (char)num7;
1405 return true;
1406 }
1407 if (typeof(TOther) == typeof(uint))
1408 {
1409 uint num8 = (uint)(object)value;
1410 if (num8 > 65535)
1411 {
1412 result = '\0';
1413 return false;
1414 }
1415 result = (char)num8;
1416 return true;
1417 }
1418 if (typeof(TOther) == typeof(ulong))
1419 {
1420 ulong num9 = (ulong)(object)value;
1421 if (num9 > 65535)
1422 {
1423 result = '\0';
1424 return false;
1425 }
1426 result = (char)num9;
1427 return true;
1428 }
1429 if (typeof(TOther) == typeof(UIntPtr))
1430 {
1431 UIntPtr uIntPtr = (UIntPtr)(object)value;
1432 if ((nuint)uIntPtr > 65535)
1433 {
1434 result = '\0';
1435 return false;
1436 }
1437 result = (char)(nuint)uIntPtr;
1438 return true;
1439 }
1441 result = '\0';
1442 return false;
1443 }
1444
1445 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1446 static bool INumber<char>.TryParse([NotNullWhen(true)] string s, NumberStyles style, IFormatProvider provider, out char result)
1447 {
1448 return TryParse(s, out result);
1449 }
1450
1451 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1452 static bool INumber<char>.TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider provider, out char result)
1453 {
1454 if (s.Length != 1)
1455 {
1456 result = '\0';
1457 return false;
1458 }
1459 result = s[0];
1460 return true;
1461 }
1462
1463 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1464 static char IParseable<char>.Parse(string s, IFormatProvider provider)
1465 {
1466 return Parse(s);
1467 }
1468
1469 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1470 static bool IParseable<char>.TryParse([NotNullWhen(true)] string s, IFormatProvider provider, out char result)
1471 {
1472 return TryParse(s, out result);
1473 }
1474
1475 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1476 static char IShiftOperators<char, char>.operator <<(char value, int shiftAmount)
1477 {
1478 return (char)((uint)value << shiftAmount);
1479 }
1480
1481 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1482 static char IShiftOperators<char, char>.operator >>(char value, int shiftAmount)
1483 {
1484 return (char)((int)value >> shiftAmount);
1485 }
1486
1487 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1489 {
1490 if (s.Length != 1)
1491 {
1493 }
1494 return s[0];
1495 }
1496
1497 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1498 static bool ISpanParseable<char>.TryParse(ReadOnlySpan<char> s, IFormatProvider provider, out char result)
1499 {
1500 if (s.Length != 1)
1501 {
1502 result = '\0';
1503 return false;
1504 }
1505 result = s[0];
1506 return true;
1507 }
1508
1509 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1510 static char ISubtractionOperators<char, char, char>.operator -(char left, char right)
1511 {
1512 return (char)(left - right);
1513 }
1514
1515 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1516 static char IUnaryNegationOperators<char, char>.operator -(char value)
1517 {
1518 return (char)(0 - value);
1519 }
1520
1521 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1522 static char IUnaryPlusOperators<char, char>.operator +(char value)
1523 {
1524 return value;
1525 }
1526}
static long ToInt64(object? value)
Definition Convert.cs:1623
static int ToInt32(object? value)
Definition Convert.cs:1320
static short ToInt16(object? value)
Definition Convert.cs:1038
static byte ToByte(object? value)
Definition Convert.cs:900
static uint ToUInt32(object? value)
Definition Convert.cs:1470
static ulong ToUInt64(object? value)
Definition Convert.cs:1738
static ushort ToUInt16(object? value)
Definition Convert.cs:1177
static sbyte ToSByte(object? value)
Definition Convert.cs:745
static object DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
Definition Convert.cs:269
static UnicodeCategory GetUnicodeCategory(char ch)
static UnicodeCategory GetUnicodeCategoryInternal(string value, int index)
static double GetNumericValueInternal(string s, int index)
static CultureInfo CurrentCulture
static char ToLowerInvariant(char c)
Definition TextInfo.cs:169
static char ToUpperInvariant(char c)
Definition TextInfo.cs:427
static byte Clamp(byte value, byte min, byte max)
Definition Math.cs:435
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static int DivRem(int a, int b, out int result)
Definition Math.cs:329
static byte Max(byte val1, byte val2)
Definition Math.cs:738
static int TrailingZeroCount(int value)
static bool IsPow2(int value)
static int PopCount(uint value)
static int Log2(uint value)
static int LeadingZeroCount(uint value)
static string ArgumentOutOfRange_InvalidHighSurrogate
Definition SR.cs:1042
static string ArgumentOutOfRange_Index
Definition SR.cs:30
static string Argument_InvalidLowSurrogate
Definition SR.cs:704
static string InvalidCast_FromTo
Definition SR.cs:1392
static string ArgumentOutOfRange_InvalidUTF32
Definition SR.cs:1046
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Arg_MustBeChar
Definition SR.cs:256
static string Format_NeedSingleChar
Definition SR.cs:1356
static string Argument_InvalidHighSurrogate
Definition SR.cs:696
static string ArgumentOutOfRange_InvalidLowSurrogate
Definition SR.cs:1044
Definition SR.cs:7
static bool IsValidUnicodeScalar(uint value)
static void ThrowNotSupportedException(ExceptionResource resource)
static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
static void ThrowArgumentNullException(string name)
static TResult AdditiveIdentity
static TSelf RotateRight(TSelf value, int rotateAmount)
static TSelf LeadingZeroCount(TSelf value)
static TSelf PopCount(TSelf value)
static TSelf TrailingZeroCount(TSelf value)
static TSelf RotateLeft(TSelf value, int rotateAmount)
static bool IsPow2(TSelf value)
static TSelf Log2(TSelf value)
short ToInt16(IFormatProvider? provider)
char ToChar(IFormatProvider? provider)
byte ToByte(IFormatProvider? provider)
decimal ToDecimal(IFormatProvider? provider)
object ToType(Type conversionType, IFormatProvider? provider)
uint ToUInt32(IFormatProvider? provider)
DateTime ToDateTime(IFormatProvider? provider)
int ToInt32(IFormatProvider? provider)
long ToInt64(IFormatProvider? provider)
ushort ToUInt16(IFormatProvider? provider)
double ToDouble(IFormatProvider? provider)
float ToSingle(IFormatProvider? provider)
sbyte ToSByte(IFormatProvider? provider)
ulong ToUInt64(IFormatProvider? provider)
bool ToBoolean(IFormatProvider? provider)
string ToString(string? format, IFormatProvider? formatProvider)
static TSelf MinValue
static TSelf MaxValue
static TSelf Max(TSelf x, TSelf y)
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out TSelf result)
static TSelf Parse(string s, NumberStyles style, IFormatProvider? provider)
static TSelf Sign(TSelf value)
static TSelf Min(TSelf x, TSelf y)
static TSelf One
Definition INumber.cs:10
static TSelf Zero
Definition INumber.cs:12
static TSelf Abs(TSelf value)
static TSelf Clamp(TSelf value, TSelf min, TSelf max)
static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out TSelf result)
static TSelf Parse(string s, IFormatProvider? provider)
bool TryFormat(Span< char > destination, out int charsWritten, ReadOnlySpan< char > format, IFormatProvider? provider)
static bool TryParse(ReadOnlySpan< char > s, IFormatProvider? provider, out TSelf result)
static TSelf Parse(ReadOnlySpan< char > s, IFormatProvider? provider)
TypeCode
Definition TypeCode.cs:4
static bool IsControl(string s, int index)
Definition Char.cs:402
static string ToString(char c)
Definition Char.cs:132
static void ConvertToUtf32_ThrowInvalidArgs(uint highSurrogateOffset)
Definition Char.cs:792
int CompareTo(object? value)
Definition Char.cs:104
bool Equals(char obj)
Definition Char.cs:99
static bool IsLetter(char c)
Definition Char.cs:206
static bool IsSeparatorLatin1(char c)
Definition Char.cs:550
static bool CheckSymbol(UnicodeCategory uc)
Definition Char.cs:604
static bool IsDigit(string s, int index)
Definition Char.cs:415
static bool IsSurrogatePair(char highSurrogate, char lowSurrogate)
Definition Char.cs:764
readonly char m_value
Definition Char.cs:15
static char ToLowerInvariant(char c)
Definition Char.cs:312
static bool IsUpper(char c)
Definition Char.cs:229
static ReadOnlySpan< byte > Latin1CharInfo
Definition Char.cs:21
static char ToUpper(char c)
Definition Char.cs:288
static bool CheckLetter(UnicodeCategory uc)
Definition Char.cs:201
override int GetHashCode()
Definition Char.cs:84
static bool IsLower(string s, int index)
Definition Char.cs:469
static double GetNumericValue(char c)
Definition Char.cs:693
static bool IsSurrogate(char c)
Definition Char.cs:586
int CompareTo(char value)
Definition Char.cs:117
static bool IsInRange(char c, char min, char max)
Definition Char.cs:191
string ToString(IFormatProvider? provider)
Definition Char.cs:127
static double GetNumericValue(string s, int index)
Definition Char.cs:698
static bool IsSurrogatePair(string s, int index)
Definition Char.cs:747
static bool IsInRange(UnicodeCategory c, UnicodeCategory min, UnicodeCategory max)
Definition Char.cs:196
static bool IsLower(char c)
Definition Char.cs:238
static bool IsSeparator(char c)
Definition Char.cs:559
static bool IsUpper(string s, int index)
Definition Char.cs:636
static char char Remainder INumber< char >. DivRem(char left, char right)
Definition Char.cs:1254
static char ToUpper(char c, CultureInfo culture)
Definition Char.cs:279
static bool IsNumber(char c)
Definition Char.cs:492
static char ToLower(char c, CultureInfo culture)
Definition Char.cs:298
static char Quotient
Definition Char.cs:1254
static bool IsSeparator(string s, int index)
Definition Char.cs:568
static bool CheckPunctuation(UnicodeCategory uc)
Definition Char.cs:247
static bool CheckSeparator(UnicodeCategory uc)
Definition Char.cs:545
static bool IsLowSurrogate(char c)
Definition Char.cs:729
static bool IsHighSurrogate(string s, int index)
Definition Char.cs:716
static bool IsLowSurrogate(string s, int index)
Definition Char.cs:734
static UnicodeCategory GetUnicodeCategory(char c)
Definition Char.cs:667
const char MaxValue
Definition Char.cs:17
static bool IsDigit(char c)
Definition Char.cs:182
static bool IsWhiteSpace(char c)
Definition Char.cs:220
static bool CheckNumber(UnicodeCategory uc)
Definition Char.cs:487
static bool IsPunctuation(char c)
Definition Char.cs:252
static char ToUpperInvariant(char c)
Definition Char.cs:293
static bool IsNumber(string s, int index)
Definition Char.cs:505
static bool IsLetterOrDigit(char c)
Definition Char.cs:270
static bool CheckLetterOrDigit(UnicodeCategory uc)
Definition Char.cs:261
static bool IsLatin1(char c)
Definition Char.cs:69
static bool IsWhiteSpaceLatin1(char c)
Definition Char.cs:215
const char MinValue
Definition Char.cs:19
static bool IsSymbol(char c)
Definition Char.cs:609
static bool IsLetter(string s, int index)
Definition Char.cs:433
static bool TryParse([NotNullWhen(true)] string? s, out char result)
Definition Char.cs:167
static UnicodeCategory GetLatin1UnicodeCategory(char c)
Definition Char.cs:79
static bool IsAscii(char c)
Definition Char.cs:74
static bool IsSurrogate(string s, int index)
Definition Char.cs:591
TypeCode GetTypeCode()
Definition Char.cs:317
static char ToLower(char c)
Definition Char.cs:307
static bool IsHighSurrogate(char c)
Definition Char.cs:711
static char Parse(string s)
Definition Char.cs:154
static int ConvertToUtf32(string s, int index)
Definition Char.cs:801
static int ConvertToUtf32(char highSurrogate, char lowSurrogate)
Definition Char.cs:780
static string ConvertFromUtf32(int utf32)
Definition Char.cs:771
static bool IsLetterOrDigit(string s, int index)
Definition Char.cs:451
static bool IsWhiteSpace(string s, int index)
Definition Char.cs:654
override bool Equals([NotNullWhen(true)] object? obj)
Definition Char.cs:89
static bool IsControl(char c)
Definition Char.cs:397
static UnicodeCategory GetUnicodeCategory(string s, int index)
Definition Char.cs:676
override string ToString()
Definition Char.cs:122
static bool IsPunctuation(string s, int index)
Definition Char.cs:527
static bool IsSymbol(string s, int index)
Definition Char.cs:618
static Rune UnsafeCreate(uint scalarValue)
Definition Rune.cs:643