Rust String (String) Detailed Explanation


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 Stringthe 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:

Guess you like

Origin blog.csdn.net/weixin_50964512/article/details/130279470