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 ) ?
lst.Select(x => x * x ).ToList();
Hope that helps,
Dan