官术网_书友最值得收藏!

Strings

Typically, a string can be defined in one of two ways:

let myName = "my name"; 

This is known as a string slice. These will be dealt with in a while.

The second way is to use String::new();. This is a String, with a capital S. It is allocated in the heap and can grow dynamically.

At this point, it would be a good idea to break with the current narrative and discuss how Rust uses memory, as it will help greatly with explaining a number of upcoming topics.

主站蜘蛛池模板: 商水县| 四子王旗| 济阳县| 罗城| 吉木乃县| 铁岭县| 涞水县| 新田县| 金川县| 淅川县| 河北省| 洛宁县| 桂东县| 秀山| 万年县| 景宁| 石屏县| 巢湖市| 科技| 梁山县| 三原县| 讷河市| 清水县| 九龙坡区| 板桥市| 山东省| 老河口市| 离岛区| 元谋县| 乐山市| 西充县| 江安县| 娄底市| 安丘市| 南乐县| 新乡县| 民权县| 信阳市| 石柱| 商南县| 成都市|