Answers for "ruby is there a way to check if string is integer"

-1

ruby check if string is integer

class String
  def numeric?
    Float(self) != nil rescue false
  end
end
"Hello World!".numeric?
Posted by: Guest on June-16-2020

Code answers related to "ruby is there a way to check if string is integer"

Browse Popular Code Answers by Language