std-method

str::eq_ignore_ascii_case

Compare with ASCII letter case ignored; non-ASCII bytes must still match. Expected stdout (not executed): true false Common mistake: Using this method as Unicode case-insensitive search.

Formal Syntax & Structure

rust syntaxrust
fn eq_ignore_ascii_case(&self, other: &str) -> bool

Working Example

Example Snippetrust
fn main() {    println!("{} {}", "GET".eq_ignore_ascii_case("get"), "É".eq_ignore_ascii_case("é"));}
Rust Reference