提取字符中中文的方法

匹配中文字符的正则表达式: [\u4e00-\u9fa5]

Regex r = new Regex("[\u4e00-\u9fa5]",RegexOptions.Multiline);

            MatchCollection matchs = r.Matches(this.ClassID.SelectedItem.Text);
            string aa="";
            foreach (Match m in matchs)
            {
                aa += m.ToString();
            }
           
            this.ClassNameEdit.Text = aa;

posted @ 2009-05-18 18:33  刘强 cnblogs  阅读(1397)  评论(5编辑  收藏  举报