日期:2014-05-17 浏览次数:21092 次
int count=(from s in str where s > 0x4E00 && s < 0x9FA5 select s).Count();
var u = from s in str
where s > 0x4E00 && s < 0x9FA5
select s;
//
u.ToList().ForEach
(s =>
{
Console.Write(s + " ");
}
);
//
Console.WriteLine(u.Count());
List<char> cCharacters = new List<char>();
for (int i = 0; i < str.Length; i++)
{
if (str[i] > 0x4E00 && str[i] < 0x9FA5)
cCharacters.Add(str[i]);
}
foreach (char ch in cCharacters)
{
Console.Write(ch+" ");
}
Console.WriteLine(cCharacters.Count);