Search⌘ K
AI Features

Character and String

Explore the fundamental character and string types in Rust, understanding how to define them explicitly and implicitly. Gain knowledge of Rust's unique 4-byte character storage and learn to handle various character sets including emojis and Unicode. This lesson prepares you to work confidently with text data in Rust applications.

Character

The variable is used to store a single character value, such as a single digit or a single alphabet. The value assigned to a char variable is enclosed in a single quote('') .

Note: Unlike some other languages, a character in Rust takes up 4 bytes rather than a single byte. It does so because it can ...