(Ruby) Is there a function to easily find the first number in a string?

Viewed 6818

For example, if I typed "ds.35bdg56" the function would return 35. Is there a pre-made function for something like that or do I need to iterate through the string, find the first number and see how long it goes and then return that?

3 Answers
Related