📜  rust 将字符串转换为 int - Rust 代码示例

📅  最后修改于: 2022-03-11 14:49:24.652000             🧑  作者: Mango

代码示例1
//You can convert a string to an integer using the parse method
let my_string = "27".to_string();  // `parse()` works with `&str` and `String`!
let my_int = my_string.parse::().unwrap();