26 April 2017

sumUpNumbers

My solution:
int sumUpNumbers(string inputString) 
{
    return Regex.Matches(inputString, "\\d+").Cast<Match>().Sum(match => int.Parse(match.Value));
}

Previous Next