Wednesday, November 25, 2020

Is It Digits?

Does a String value consist only of digits?
if (mystr.chars().allMatch(Character::isDigit)) {
  System.out.println("all digits");
}