Saved from https://stackoverflow.com/questions/39743299/check-if-a-string-contains-only-digits-in-ruby
def check_string(string) string.scan(/\D/).empty? end