Convert String To I32

[Solved] Convert String To I32 | Rust - Code Explorer | yomemimo.com
Question : convert string to i32

Answered by : huldar

//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::<i32>().unwrap();

Source : https://stackoverflow.com/questions/27043268/convert-a-string-to-int-in-rust | Last Update : Tue, 04 Aug 20

Answers related to convert string to i32

Code Explorer Popular Question For Rust