get only digits from string c# code example Example: return every digit on a string c# return Regex.Replace(input, @"[^0-9]+", "");