I want to strip away all letters in a string, which are not numeric. Preferably a solution made with Regular Expressions or something. And in C#.
How to do that?
I want to strip away all letters in a string, which are not numeric.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using Regex:
\Dis the complement of\d– matches everything that isn’t a digit.+will match one or more of them (it usually works a little better than one by one).Using Linq (on .Net 4.0):