std-method

str::to_uppercase

Create Unicode uppercase text; a single scalar can expand into more than one. This is not a locale-specific transformation. Expected stdout (not executed): STRASSE Common mistake: Assuming uppercase preserves byte length or scalar count.

Formal Syntax & Structure

rust syntaxrust
fn to_uppercase(&self) -> String

Working Example

Example Snippetrust
fn main() {    println!("{}", "straße".to_uppercase());}
Rust Reference