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

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.

主站蜘蛛池模板: 德江县| 泗水县| 微山县| 思南县| 凌海市| 时尚| 望谟县| 丰城市| 英吉沙县| 瑞安市| 屯门区| 公安县| 台南市| 巴南区| 广水市| 惠东县| 崇义县| 镇远县| 定西市| 循化| 柘城县| 建瓯市| 尚义县| 兴义市| 万宁市| 平湖市| 保山市| 广安市| 福州市| 河曲县| 宜阳县| 高阳县| 安吉县| 泗阳县| 牟定县| 北川| 左云县| 都兰县| 桦南县| 仙桃市| 文登市|