请问各位:如何判断一个字符串是否为中英文混合的字符串呢〉?

yinsuxia 2012-10-13 01:43:26
如题,比如说:“阿AA莎力A的ccc”这种的。。。。需要怎么判断呢?
...全文
208 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]
不考虑效率,可以用:

C# code

string s = "你好我是three流垃圾菜鸟";
bool result = Regex.IsMatch(s, @"^[A-Za-z\u4e00-\u9fa5]+$") && Regex.IsMatch(s, @"[\u4e00-\u9fa5]+") && Regex.IsMatch……
[/Quote]
你太不厚道了、变着法子讽刺人家啊
回帖只为拿点可用分!!!
  • 打赏
  • 举报
回复

string str = "你的string";
bool flag = Regex.IsMatch(str, @"^(?=.*?[\u4e00-\u9fa5])(?=.*?[a-zA-Z])[\u4e00-\u9fa5a-zA-Z]+$");
dalmeeme 2012-10-13
  • 打赏
  • 举报
回复
不考虑效率,可以用:
	string s = "你好我是three流垃圾菜鸟";
bool result = Regex.IsMatch(s, @"^[A-Za-z\u4e00-\u9fa5]+$") && Regex.IsMatch(s, @"[\u4e00-\u9fa5]+") && Regex.IsMatch(s, @"[A-Za-z]+");
风之影子 2012-10-13
  • 打赏
  • 举报
回复
http://download.csdn.net/download/yangsh3002/4360552
风之影子 2012-10-13
  • 打赏
  • 举报
回复
http://blog.163.com/yanglei_sky/blog/static/377263892011112644846987/

110,535

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧