morristech
3/27/2020 - 1:18 PM

Check if a string contains only digits in ruby

def check_string(string)
  string.scan(/\D/).empty?
end