示例#1
0
 public static bool IsWhiteSpaceOrNewLine(char32 c)
 {
     return(c == ' ' ||  // space
            c == '\t' || // horizontal tab
            c == '\r' || // \r
            c == '\n');  // \n
 }
示例#2
0
 public static void AppendUtf32(this StringBuilder builder, char32 utf32)
 {
     if (utf32 < 65536)
     {
         builder.Append((char)utf32);
         return;
     }
     utf32 -= 65536;
     builder.Append((char)(utf32 / 1024 + 55296));
     builder.Append((char)(utf32 % 1024 + 56320));
 }
示例#3
0
 public static bool IsDateTime(char32 c)
 {
     return(IsDigit(c) || c == ':' || c == '-' || c == 'Z' || c == 'T' || c == 'z' || c == 't' || c == '+' || c == '.');
 }
示例#4
0
 public static bool IsDigit(char32 c)
 {
     return(c >= '0' && c <= '9');
 }
示例#5
0
 public static bool IsValidUnicodeScalarValue(char32 c)
 {
     return(c >= 0 && c <= 0xD7FF || c >= 0xE000 && c < 0x10FFFF);
 }
示例#6
0
 public static bool IsIdentifierContinue(char32 c)
 {
     return((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
 }
示例#7
0
 public static bool IsKeyContinue(char32 c)
 {
     return((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || c == '-' || c >= '0' && c <= '9');
 }
示例#8
0
 private static bool IsBinary(char32 c)
 {
     return(c == '0' || c == '1');
 }
示例#9
0
 private static bool IsOctal(char32 c)
 {
     return(c >= '0' && c <= '7');
 }
示例#10
0
 private static bool IsHex(char32 c)
 {
     return((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
 }
示例#11
0
 public static int BinaryToDecimal(char32 c)
 {
     Debug.Assert(IsBinary(c));
     return(c - '0');
 }
示例#12
0
 public static int OctalToDecimal(char32 c)
 {
     Debug.Assert(IsOctal(c));
     return(c - '0');
 }
示例#13
0
 public static int HexToDecimal(char32 c)
 {
     Debug.Assert(IsHex(c));
     return((c >= '0' && c <= '9') ? c - '0' : (c >= 'a' && c <= 'f') ? (c - 'a') + 10 : (c - 'A') + 10);
 }
示例#14
0
 public static bool IsNewLine(char32 c)
 {
     return(c == '\r' || // \r
            c == '\n');  // \n
 }
示例#15
0
 public static bool IsControlCharacter(char32 c)
 {
     return(c <= 0x1F || c == 0x7F);
 }
示例#16
0
 public static bool IsWhiteSpace(char32 c)
 {
     return(c == ' ' || // space
            c == '\t'); // horizontal tab
 }