E
E
eldar_web2016-03-01 19:07:00
Ruby on Rails
eldar_web, 2016-03-01 19:07:00

How to remove characters from a string in Ruby?

For example, there is . I want to remove all characters and leave only numbers (89634204010). How can this be done? number = "8(963)-420-40-10"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TyzhSysAdmin, 2016-03-01
@POS_troi

You can stackoverflow.com/questions/17767716/extract-phone...
but in general there is a good gem on the topic of phone numbers https://github.com/sstephenson/global_phone

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question