|
-
Jun 25th, 2009, 08:03 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] remove letters
Hi,
There is a string such as:
string s = "12445-65432 abc, 98767-45364 th, 56749-23198"
How can I remove the letters so that I end up with:
s = "12445-65432, 98767-45364, 56749-23198"
Thanks
-
Jun 25th, 2009, 02:07 PM
#2
Re: remove letters
Code:
string s = "12445-65432 abc, 98767-45364 th, 56749-23198";
string result = Regex.Replace(s, @"\s?[a-zA-Z]\s?", string.Empty);
For a breakdown, have a read through on http://www.regular-expressions.info/reference.html. Brilliant author, very good read
-
Jun 26th, 2009, 01:13 AM
#3
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|