Knowledge Garden

Search

Search IconIcon to open search

Character Types in Rust

Last updated Dec 1, 2022 Edit Source

# Character type

char

could be anything from sound, icon, action, letters.

char consists of 4 bytes. typically makes characters UCS-4/UTF-32 types

character literals are specified using single quotes

1
let letter ='a';

characters are mostly useless, use strings instead

Strings DO NOT use chars in them as they are UTF-8

# Character type

char

could be anything from sound, icon, action, letters.

char consists of 4 bytes. typically makes characters UCS-4/UTF-32 types

character literals are specified using single quotes

1
let letter ='a';

characters are mostly useless, use strings instead

Strings DO NOT use chars in them as they are UTF-8