string tmp = "1+2+3+5"; int total = tmp.Split('+').ToList().Sum(item => Convert.ToInt32(item)); Console.WriteLine(tmp + " = " + total.ToString());
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)