File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

un-format a phone number

 
Marie Mazerolle
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Phone numbers are displayed in my app as (555) 555-6676. I figured out how to use regular expressions to verify if it's in the correct format, but now I have to save the phone numbers as 5555556676 in the database.
What would be the best way to strip the extra characters from my string? I tried myPhoneString.replace( '(', '' );
but it will not accept empty character literals...
Thanks,
Marie
 
Marie Mazerolle
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops, I just found out that I can also use regexp to remove the offending characters.
Marie
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic