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

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.

主站蜘蛛池模板: 关岭| 四川省| 长治县| 喀喇沁旗| 南开区| 鹤峰县| 雷山县| 抚宁县| 西峡县| 甘孜| 寿阳县| 温州市| 德安县| 麻城市| 洪江市| 福贡县| 乳源| 浙江省| 册亨县| 永州市| 揭阳市| 福安市| 攀枝花市| 鹰潭市| 荃湾区| 高雄市| 武威市| 区。| 梧州市| 弋阳县| 岱山县| 伽师县| 龙门县| 沈阳市| 遂平县| 额尔古纳市| 缙云县| 旬邑县| 古丈县| 吉隆县| 白沙|