C#字符串的全角是指用二個字節來表示的一個字符
C#字符串的半角是用一個字節來表示的一個字符
這樣的話我們就可以用string.length 和System.text.Encoding.Default.GetByteCount來判斷
其中string.length表示C#字符串字符串的字符數,
System.text.Encoding.Default.GetByteCount表示字符串的字節數。
string checkString = textBox1.Text.ToString(); for (int counter = 0; counter < checkString.Length; counter++) { if (2 * checkString[counter].ToString().Length == Encoding.Default.GetByteCount(checkString[counter].ToString())) { MessageBox.Show("full width" + checkString[counter].ToString() + "[" + (counter+1) + "]"); } }