Microsoft 使用此规则作为其复杂性规则之一:
Any Unicode character that is categorized as an alphabetic character but is not uppercase or lowercase. This includes Unicode characters from Asian languages.
测试通常的规则,比如大写可以像password.Any(char.IsUpper)
一样简单。
我可以在 C# 中使用什么测试来测试不是大写或小写的字母 Unicode 字符?
最佳答案
规则的直译如何:
password.Any(c => Char.IsLetter(c) &&
!Char.IsUpper(c) &&
!Char.IsLower(c))
关于c# - 如何确定不是大写或小写的字母字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25256202/