- 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.
推薦閱讀
- Oracle從入門到精通(第3版)
- ExtGWT Rich Internet Application Cookbook
- C# 2012程序設計實踐教程 (清華電腦學堂)
- PHP 從入門到項目實踐(超值版)
- The React Workshop
- 老“碼”識途
- PostgreSQL Replication(Second Edition)
- GeoServer Beginner's Guide(Second Edition)
- HTML5 APP開發從入門到精通(微課精編版)
- 鴻蒙OS應用編程實戰
- Python語言科研繪圖與學術圖表繪制從入門到精通
- 計算語言學導論
- Instant GLEW
- 產品架構評估原理與方法
- Learning Zimbra Server Essentials