.is_digit(..)
with known radix RS-W1038The standard library contains shorthand methods for .is_digit(10)
and
.is_digit(16)
; is_ascii_digit
and is_ascii_hexdigit
respectively.
Prefer using the shorthand methods instead. As of 1.60 (April 2022), there is no shorthand for octal digits.
'7'.is_digit(10);
'a'.is_digit(16);
'7'.is_ascii_digit();
'a'.is_ascii_hexdigit();