onlyContainsDigits function

bool onlyContainsDigits(
  1. String string
)

A convenient way for checking if there are only digits. Also null is accepted (in this case the method returns false...)

Implementation

bool onlyContainsDigits(String string) =>
    filled(string) && string.onlyContainsDigits();