Click here to Skip to main content
Click here to Skip to main content

How to remove characters from a Numeric String:

By , 7 Jul 2011
 
Regex.Replace(testnumber, "[^\d]", "") is sufficient to remove all non-numeric characters from string testnumber.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Prerak Patel
Software Developer
India India
Member
Working since 2006 on VBA, VB6, VB.Net, C#, ASP.Net, MSSQL



  • The fear of suffering is worse than the suffering itself.
  • People need not fear the unknown if they are capable of achieving what they need and want.
  • Every blessing ignored becomes a curse.
  • Sometimes what's in your head isn't as crazy as you think.
  • We never really grow up, we only learn how to act in public.
  • You can make very bad teams with very good individuals.
  • Admitting mistakes means you have a sense of responsibility in your actions and that shows you are more matured than almost anyone. -Nithin


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralReason for my vote of 5 short and sweet trick, I always love...memberHiren Solanki30 Aug '11 - 1:37 
GeneralReason for my vote of 5 More concisememberCatalin Hatmanu8 Jul '11 - 10:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 7 Jul 2011
Article Copyright 2011 by Prerak Patel
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid