Dot Net Sample Codings
Saturday, March 30, 2013
How to remove alphabetic characters from a string
string
a =
"(570) 847—1059 Alternate"
;
string
b =
"570 847 1059 Alternate"
;
string
c =
"570-847—1059 Alternate"
;
a =
Regex
.Replace(a,
"[A-Za-z]"
,
""
);
b =
Regex
.Replace(b,
"[A-Za-z]"
,
""
);
c =
Regex
.Replace(c,
"[A-Za-z]"
,
""
);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment