Article Directory
foreword
In rust String
, it is a very commonly used one crate
. Its bottom layer involves the concept of ownership in rust, but this is not the content of this chapter. If you are interested in the concept of rust ownership, you can check another article: Rust ownership
The purpose of this article is to introduce String
the basic usage, and what commonly used functions can be used
1. Basic concepts
Strings are composed of a series of characters, and the number of bytes used to store a character in a computer is not exactly the same.
For example the following code: