gsub to remove spaces parenthesis and dashes out of a phone number input field

Tagged with Ruby

Language: Ruby

View as text

@phone_number.gsub(/([-() ])/, '')
Original snippet written by Jon Kinney
Last updated at 14:57 PM on Aug 08, 2008

SnippetStash costs money to host and develop. The service is free for everyone to use
but if you found it useful please consider making a small donation.