String to int
Rust
#![allow(unused)]
fn main() {
let my_str = "1024".to_string();
let my_int = my_string.parse::<u32>();
}
Python
x = "1024"
i = int(x)
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
#![allow(unused)]
fn main() {
let my_str = "1024".to_string();
let my_int = my_string.parse::<u32>();
}
x = "1024"
i = int(x)