中易网

c#如何判断字符串中是否有字母

答案:2  悬赏:20  
解决时间 2021-03-06 23:55
c#如何判断字符串中是否有字母
最佳答案
if (s.Any(x => char.IsLetter(x)))
全部回答
方法一:用正则表达式的方法 //引用的命名空间using system.text.regularexpressions; public bool isexists(string str){return regex.matches(str, "[a-za-z]").count 0;}方法二:#region 判断字符串是否有字母 ///
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯