using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
string str = "fdsa汉jklfda字ljklfdsa提jkflds取ljfjkds";
string newstr = "";
Regex rg = new Regex(@"[\u4e00-\u9fa5]");
for (int ii = 0; ii < str.Length; ii++)
{
string val = str.Substring(ii, 1);
if (rg.IsMatch(val))
{
newstr += val;
}
}
Console.WriteLine(newstr);
Console.Read();
}
}
}
阅读(645) | 评论(0) | 转发(0) |