Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
:timing
:sccache 1Character¶
Rust supports unicode characters. Notice that emojis are single unicode characters.
let c1 = 'a';
c1'a'let c2 = '\u{1f604}';
c2'😄'char::from_u32¶
'Z' as u3290char::from_u32(90)Some('Z')let c = char::from_u32(0x2764);
cSome('❤')char::from_digit¶
char::from_digit(9, 10)Some('9')char::to_uppercase¶
char::to_uppercase returns an interator instead of a char!
'a'.to_uppercase()ToUppercase(One('A'))'a'.to_uppercase().next()Some('A')'a'.to_uppercase().next().unwrap()'A'