Extract digits from a string

How to extract numeric values from input string c#.

public static string ExtractDigits(string input)
{
 return new String(input.Where(x => x >= '0' && x <= '9').ToArray());
}


DEMO
Extract digits from a string Extract digits from a string Reviewed by Bhaumik Patel on 5:06 AM Rating: 5