当前位置:网站首页>Rust:如何 match 匹配 String 字符串?
Rust:如何 match 匹配 String 字符串?
2022-04-23 05:45:00 【许野平】
废话少说,直接贴代码看例子吧!
fn main() {
let s = String::from("hello");
match &s as &str {
"hello" => println!("hello"),
_ => (),
}
}
版权声明
本文为[许野平]所创,转载请带上原文链接,感谢
https://yeping.blog.csdn.net/article/details/123065112
边栏推荐
- Code neat way to learn
- 卡尔曼滤波与惯性组合导航
- Best practices for MySQL storage time
- [untitled] database - limit the number of returned rows
- Event listener
- C array
- Common sense of thread pool
- Explanation of login page
- Unsupervised denoising - [tmi2022] ISCL: dependent self cooperative learning for unpaired image denoising
- Substring Inversion (Easy Version)
猜你喜欢
Substring Inversion (Easy Version)
SQL -- data definition
Mysql database foundation
Understanding and installing MySQL
Generate excel template (drop-down selection, multi-level linkage)
Addition, deletion, query and modification of data
Export of data
[leetcode 401] binary Watch
The bottom implementation principle of thread - static agent mode
IO multiplexing of 09 redis
随机推荐
List segmentation best practices
Formation à la programmation
Record the installation and configuration of gestermer on TX2, and then use GST RTSP server
从源代码到可执行文件的过程
C array
[leetcode 350] intersection of two arrays II
定位器
Definition of C class and method
电机与拖动(戚金清版)学习整理
2. Devops sonar installation
Qthread simple test understanding
Failure to deliver XID in Seata distributed transaction project
自动控制原理知识点整合归纳(韩敏版)
[leetcode 228] summary interval
解决ArcGIS分区统计显示太多唯一值执行失败
Detection technology and principle
Use of multithreaded executors
Robocode教程3——Robo机器剖析
The bottom implementation principle of thread - static agent mode
[leetcode 67] sum of two binary numbers