- 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.
推薦閱讀
- Learn ECMAScript(Second Edition)
- Oracle從入門到精通(第3版)
- Hyper-V 2016 Best Practices
- Java面向對象程序開發(fā)及實戰(zhàn)
- Nginx Essentials
- Clojure Reactive Programming
- Illustrator CS6設計與應用任務教程
- JSP程序設計與案例實戰(zhàn)(慕課版)
- Python Projects for Kids
- 精通Spring:Java Web開發(fā)與Spring Boot高級功能
- 數(shù)據(jù)結構:Python語言描述
- 計算機應用基礎
- Python量子計算實踐:基于Qiskit和IBM Quantum Experience平臺
- 三步學Python
- Alfresco for Administrators