I have a piece of code where I ask the user to input a number as an answer to my question.
I can do to_i but tricky/garbage inputs would escape through to_i. For example, if a user inputs 693iirum5 as an answer then #to_i would strip it to 693.
Please suggest a function, not a regular expression. Thanks in advance for replying.