using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
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();
}
}
}
{
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();
}
}
}
最后
以上就是踏实鸡最近收集整理的关于汉字提取(C#)的全部内容,更多相关汉字提取(C#)内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复