ruby check if int doulbe digit code example
Example: ruby check if string is integer
class String
def numeric?
Float(self) != nil rescue false
end
end
"Hello World!".numeric?
class String
def numeric?
Float(self) != nil rescue false
end
end
"Hello World!".numeric?