In [ ]:
:timing
:sccache 1
Character¶
Rust supports unicode characters. Notice that emojis are single unicode characters.
In [6]:
let c1 = 'a';
c1
Out[6]:
In [2]:
let c2 = '\u{1f604}';
c2
Out[2]:
char::from_u32¶
In [5]:
'Z' as u32
Out[5]:
In [2]:
char::from_u32(90)
Out[2]:
In [4]:
let c = char::from_u32(0x2764);
c
Out[4]:
char::from_digit¶
In [6]:
char::from_digit(9, 10)
Out[6]:
char::to_uppercase¶
char::to_uppercase
returns an interator instead of a char!
In [7]:
'a'.to_uppercase()
Out[7]:
In [8]:
'a'.to_uppercase().next()
Out[8]:
In [9]:
'a'.to_uppercase().next().unwrap()
Out[9]:
In [ ]: