コード例 #1
0
ファイル: CharUnicodeInfo.cs プロジェクト: ForNeVeR/pnet
 // Get the numeric value of a character.
 public static double GetNumericValue(char ch)
 {
     if (ch >= '0' && ch <= '9')
     {
         return((double)(int)(ch - '0'));
     }
     else
     {
         return(SysCharInfo.GetNumericValue(ch));
     }
 }
コード例 #2
0
ファイル: Environment.cs プロジェクト: ForNeVeR/pnet
 // Initialize the environment state.
 static Environment()
 {
     // Get the newline string.
     try
     {
         newLine = SysCharInfo.GetNewLine();
     }
     catch (NotImplementedException)
     {
         // The runtime engine does not have "SysCharInfo".
         newLine = "\n";
     }
 }
コード例 #3
0
ファイル: CharUnicodeInfo.cs プロジェクト: ForNeVeR/pnet
 // Get the digit value of a character.
 public static int GetDigitValue(char ch)
 {
     if (ch >= '0' && ch <= '9')
     {
         return((int)(ch - '0'));
     }
     else
     {
         double value  = SysCharInfo.GetNumericValue(ch);
         int    ivalue = (int)value;
         if (((double)ivalue) == value)
         {
             return(ivalue);
         }
         return(-1);
     }
 }
コード例 #4
0
ファイル: CharUnicodeInfo.cs プロジェクト: ForNeVeR/pnet
 // Get the unicode category of a character.
 public static UnicodeCategory GetUnicodeCategory(char ch)
 {
     return(SysCharInfo.GetUnicodeCategory(ch));
 }