Linq Map! or Collect! Linq Map! or Collect! ruby ruby

Linq Map! or Collect!


Map = Select

var x = new string[] { "a", "b", "c", "d"}.Select(s => s+"!");


The higher-order function map is best represented in Enumerable.Select which is an extension method in System.Linq.

In case you are curious the other higher-order functions break out like this:

reduce -> Enumerable.Aggregate
filter -> Enumerable.Where