Check out example codes for "converst string to int ruby". It will help you in understanding the concepts better.
Code Example 1
Integer('5abc') #=> ArgumentError: invalid value for Integer(): "5abc"
Integer('5') #=> 5
Learn ReactJs, React Native from akashmittal.com