Skip to main content
Nov 03, 2013
/// <summary>
/// Method deletes all non numeric characters from passed text
/// </summary>
/// <param name="text">string text</param>
/// <returns>string text without non-numeric characters</returns>
public static string RemoveNonNumeric(string text)
{
  string newText = "";
 
  if(String.IsNullOrEmpty(text))
  {
    return newText;
  }
 
  newText = Regex.Replace(text, "[^0-9]", "");
 
  return newText;
}