In .NET, you could extract just the digits from the string. Using Linq like this:
string justNumbers = new String(text.Where(Char.IsDigit).ToArray());
Don’t forget to include using System.Linq
More Related Contents:
- How do I filter all HTML tags except a certain whitelist?
- C# Regex to match the word with dot
- extract number out strings c# [closed]
- c# Regular Expression for the text below? [closed]
- How to get ALL child controls of a Windows Forms form of a specific type (Button/Textbox)?
- How to write Unicode characters to the console?
- Why is there a default instance of every form in VB.Net but not in C#?
- Get string between two strings in a string
- Using RegEx to balance match parenthesis
- Using String Format to show decimal up to 2 places or simple integer
- Mixing C# & VB In The Same Project
- Difference with Parameters.Add and Parameters.AddWithValue
- How to flatten nested objects with linq expression
- C# regex to remove non – printable characters, and control characters, in a text that has a mix of many different languages, unicode letters
- Need to perform Wildcard (*,?, etc) search on a string using Regex
- Is String a primitive type?
- Install to same path when upgrading application
- RegEx for an IP Address
- Regex word boundary expressions
- How to remove numbers from string using Regex.Replace?
- String.Format – how it works and how to implement custom formatstrings
- Return to an already open application when a user tries to open a new instance
- .Net regex: what is the word character \w?
- ‘CompanyName.Foo’ is a ‘namespace’ but is used like a ‘type’
- Regex to match a word with + (plus) signs
- Conversion tool comparisons for visual basic 6.0 [closed]
- Reflection.Emit vs CodeDOM
- How to insert a Symbol (Pound, Euro, Copyright) into a Textbox
- Dynamically changing Textbox’s AutoComplete List causes AccessViolationException, any advice?
- What’s the C# equivalent to the With statement in VB? [duplicate]