当前位置:网站首页>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
边栏推荐
- Stability building best practices
- Delete and truncate
- Kalman filter and inertial integrated navigation
- List segmentation best practices
- MySQL occasional Caton
- @Problems caused by internal dead loop of postconstruct method
- H. Are You Safe? Convex hull naked problem
- Algèbre linéaire chapitre 1 - déterminants
- Collection and map thread safety problem solving
- Event listener
猜你喜欢
Techniques et principes de détection
Framework analysis 1 Introduction to system architecture
Algèbre linéaire chapitre 1 - déterminants
Algèbre linéaire chapitre 2 - matrice et son fonctionnement
Import of data
Addition, deletion, query and modification of data
檢測技術與原理
Addition, deletion, modification and query of MySQL table
从源代码到可执行文件的过程
Type conversion in C #
随机推荐
How does MySQL convert stored seconds into dates
Use of multithreaded executors
POJ - 2955 brackets interval DP
卡尔曼滤波与惯性组合导航
[leetcode 150] evaluation of inverse Polish expression
MySQL advanced query
Why does the subscript of the array start from 0 instead of 1?
How to use comparative learning to do unsupervised - [cvpr22] training & [eccv20] image translation
渔网道路密度计算
Generation of verification code
Detection technology and principle
@Problems caused by internal dead loop of postconstruct method
2. Devops sonar installation
[leetcode 19] delete the penultimate node of the linked list
Consistent hash algorithm used for redis cache load balancing
Create binary tree
Explain of MySQL optimization
Definition of C class and method
MySQL basic madness theory
Collections multiple parameter sorting