var vals = new List<int> { 1, 2, 3, 4, 5, 6, 0,11 };
var res = vals.Select(e => 2000/e);
var vals = new List<int> { 1, 2, 3, 4, 5, 6, 0,11 };
var res = vals.Select(e =>
{
try
{
return (e => 2000/e));
}
catch(Exception)
{
return 0;
}
});
var vals = new List<int> { 1, 2, 3, 4, 5, 6, 0, 11 };
var res = vals.Select(e => e == 0 ? 0 : 2000 / e);