Check out example codes for "ruby check if string is integer". It will help you in understanding the concepts better.

Code Example 1

class String
  def numeric?
    Float(self) != nil rescue false
  end
end
"Hello World!".numeric?

Learn ReactJs, React Native from akashmittal.com