pub trait IsDigit {
// Required method
fn is_dec_digit(&self) -> bool;
}Expand description
Checks if the specified character is an ASCII digit.
This method verifies whether the character’s ASCII value falls within the range of ‘0’ (ASCII value 48) to ‘9’ (ASCII value 57).
If so, it returns true, indicating that it is a digit. Otherwise, it returns false.
§Examples
use is_digit::IsDigit;
let digit = '1';
assert!(digit.is_dec_digit());
let alpha = 'a';
assert!(!alpha.is_dec_digit());