I normally see the use of,foreach @ generics as
List<int> lst = new List<int>();
lst.Add(10);
lst.Add(20);
lst.Add(30);
lst.ForEach(x => Console.WriteLine(x));
How can i achieve something similar:
lst.ForEach(x => x *x )
?
I normally see the use of,foreach @ generics as
List<int> lst = new List<int>();
lst.Add(10);
lst.Add(20);
lst.Add(30);
lst.ForEach(x => Console.WriteLine(x));
How can i achieve something similar:
lst.ForEach(x => x *x )
?
Do you mean a map function? See this question http://stackoverflow.com/questions/702123/linq-map-or-collect