- Learning Rust
- Paul Johnson Vesa Kaihlavirta
- 91字
- 2021-07-02 23:07:16
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.
推薦閱讀
- Python概率統計
- Python 3.7網絡爬蟲快速入門
- 數據結構(Java語言描述)
- Object-Oriented JavaScript(Second Edition)
- Java EE 7 Development with NetBeans 8
- Spring Boot進階:原理、實戰與面試題分析
- Learning OpenStack Networking(Neutron)(Second Edition)
- Mastering Git
- Visualforce Developer’s guide
- Node.js區塊鏈開發
- Python編程基礎教程
- Wearable:Tech Projects with the Raspberry Pi Zero
- C/C++代碼調試的藝術
- Visual C++程序設計全程指南
- PHP典型模塊與項目實戰大全