日期:2014-05-20 浏览次数:20780 次
static void Main(string[] args)
{
string[] strings=
{
"A penny saved is a penny earned.",
"The aaxly sdj",
"the pa is no"
};
var query =
from sentence in strings
let words = sentence.Split(' ')//用空格分割成数组
from word in words
let w = word.ToLower()//把每个字母小写
where w[0] == 'a' || w[0] == 'e'
select word;
foreach (var s in query)
{
Console.WriteLine(s);
}
Console.ReadLine();
}