标签:
object[] vals = { 1, "Hello", true, "World", 9.1 };
IEnumerable<double> justStrings = vals.OfType<double>( );
foreach(var str in justStrings)
{
Console.WriteLine(str);
}
string[] names = { "Allen", "Arthur", "Bennett" };
string[] ayes = names.Where(s => s[0] == ‘A‘).ToArray();
标签:
原文地址:http://www.cnblogs.com/Fred1987/p/5932458.html