char a = '好';char b = 'a';char c = '1';Console.WriteLine(Char.IsLetter(a));//輸出:TrueConsole.WriteLine(Char.IsLetter(b));//輸出:TrueConsole.WriteLine(Char.IsLetter(c));//輸出:FalseChar.IsLetter的方法說(shuō)明// // 摘要: // 指示指定的 Unicode 字符是否屬于字母類別。// Indicates whether the specified Unicode character is categorized as an alphabetic letter. // // 參數(shù): // c: // 一個(gè) Unicode 字符。 // // 返回結(jié)果: // 如果 c 是字母,則為 true;否則,為 false。我想問(wèn)的是 難道"好"是字母?
2 回答

慕容3067478
TA貢獻(xiàn)1773條經(jīng)驗(yàn) 獲得超3個(gè)贊
MSDN: "This method determines whether a Char is a member of any category of Unicode letter."
Unicode letter包含但不僅限于英文字母。
還是用正則表達(dá)式判斷吧。

函數(shù)式編程
TA貢獻(xiàn)1807條經(jīng)驗(yàn) 獲得超9個(gè)贊
這是個(gè)很悲劇的事,當(dāng)一個(gè)char大于0x00ff的時(shí)候,他會(huì)去取UnicodeCategory……
- 2 回答
- 0 關(guān)注
- 757 瀏覽
添加回答
舉報(bào)
0/150
提交
取消