Linq Query:
Output:
//of type object[] myCollection = { "",5,"a",3.66,7,"y",2.89,"y",null,6}; //Now i only want integer values from this collection of object var myInts = myCollection.OfType(); foreach (var t in myInts) { Console.WriteLine(t); }
Output:
5
7
6
0 comments:
Post a Comment