std-method

char::is_numeric

Detect Unicode numeric characters. This includes more than ASCII decimal digits and is not sufficient validation for Rust integer parsing. Expected stdout (not executed): true false true Common mistake: Assuming numeric classification guarantees parse succeeds.

Formal Syntax & Structure

rust syntaxrust
fn is_numeric(self) -> bool

Working Example

Example Snippetrust
fn main() {    println!("{} {}", '۳'.is_numeric(), '۳'.is_ascii_digit());    println!("{}", "۳".parse::<u32>().is_err());}
Rust Reference