C# 全角符号转半角
1 public static string SBCCaseToNumberic(string SBCCase) 2 { 3 char[] c = SBCCase.ToCharArray(); 4 for (int i = 0; i < c.Length; i++) 5 { 6 byte[] b = System.Text.Encoding.Unicode.GetBytes(c, i, 1); 7 if (b.Length == 2) 8 { 9 if (b[1] == 255) 10 { 11 b[0] = (byte)(b[0] + 32); 12 b[1] = 0; 13 c[i] = System.Text.Encoding.Unicode.GetChars(b)[0]; 14 } 15 } 16 } 17 return new string(c); 18 }