\D : Matches any nondigit. Equivalent to \P{Nd} for Unicode and [^0-9] for
non-Unicode, ECMAScript behavior.
Most of the time I prefer the character codes \d over [0-9] or \D over
[^0-9] as they are more internationalized (they will work for any Unicode
numeric value, not just the ANSI 0 to 9 characters. Also they tend to be
shorter ;-)
Hope this helps
Jay
Craig Buchanan said:
Jay-
What does the \D mean?
Thanks,
Craig
Jay B. Harlow said:
Craig,
Which can be shorted to:
'strip anything that isn't a number
PhoneNumber = Regex.Replace(PhoneNumber, "\D","")
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.