您是否嘗試過使用修剪其從字符串中刪除所有前導和尾隨空白()?
例如(C#)
string cleanString = dirtyString.Trim();
要找到 「神祕」 字符的ASCII VAL:
int charVal = (int)dirty.ToCharArray()[0];
附:問問使用C#或.NET擦洗字符串是否更合適?
編輯
// algorithm for removing weird char from string
string dirtyString = " sdfsf ";
// get the offending character:
char dirtyChar = dirtyString.ToCharArray()[0];
// replace offending character with something known like an asterisk
string cleanString = dirtyString.Replace(dirtyChar, '*');
// remove asterisk from string
cleanString = cleanString.Replace("*", "");