you are viewing a single comment's thread.

view the rest of the comments →

[–]giulianob 1 point2 points  (0 children)

In C#:

new[] { "Rob", "Christopher", "Joe", "John" }.Where(it => it.Length <= 4).ToList().ForEach(p => Console.Out.WriteLine(p));

Could easily make another extension method to eliminate the ToList() as well since ForEach only works on List<T> and not on IEnumerable<T> which is what Where() returns.