Reputation: 685
I have this string - "4,450.50 $".
I need just the numbers from this string. So in this example i would like to get the number - 4450.50 back.
How could I get it?
Upvotes: 0
Views: 86
Reputation: 84353
str = "4,450.50 $"
Float str.scan(/[\d.]/).join
# => 4450.5
Upvotes: 2