C#使用正则表达式去除字符串中的汉字

string str =  "中1234";

str = Regex.Replace(str, @"[\u4e00-\u9fa5]", ""); //去除汉字


str = Regex.Replace(str, @"[^\u4e00-\u9fa5]", ""); //只留汉字

posted @ 2018-09-18 10:47  水蓝色的单翼  阅读(3800)  评论(0编辑  收藏  举报