相关疑难解决方法(0)

Rust的r#""#运算符是什么?

r#""在Rust 看到了操作员,但我找不到它的功能.它为创建JSON派上了用场:

let var1 = "test1";
let json = r#"{"type": "type1", "type2": var1}"#;
println!("{}", json) // => {"type2": "type1", "type2": var1}
Run Code Online (Sandbox Code Playgroud)

操作员的名字是r#""什么?我该如何var1评价?

string syntax rust

47
推荐指数
3
解决办法
1万
查看次数

标签 统计

rust ×1

string ×1

syntax ×1