char to upper case rust
To convert a char
to uppercase in Rust, you can use the to_ascii_uppercase
method. Here's an example:
let c: char = 'a';
let upper_c = c.to_ascii_uppercase();
println!("{}", upper_c);
This code snippet converts the character 'a' to uppercase using the to_ascii_uppercase
method and prints the result. The output will be 'A'.