How to sum array of strings with LINQ Sum method?
I have string which looks like: "1,2,4,8,16"
I have tried:
string myString = "1,2,4,8,16";
int number = myString.Split(',').Sum((x,y)=> y += int.Parse(x));
But it says that cannot Parse source type int to type ?.
I do not want to use a foreach loop to sum this numbers.