gpt4 book ai didi

c# - 如何确定不是大写或小写的字母字符

转载 作者:太空狗 更新时间:2023-10-29 20:13:27 25 4
gpt4 key购买 nike

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com