C#: Remove all non numeric characters from a string using Regex

using System.Text.RegularExpressions;
...
string newString = Regex.Replace(oldString, "[^.0-9]", "");
(If you don't want to allow the decimal delimiter in the final result, remove the . from the regular expression above).

Related posts:

Comments

comments powered by Disqus