box-o-sand/rustbyexample/conversion.d/string2.rs

8 lines
181 B
Rust
Raw Normal View History

2023-09-26 10:07:51 +00:00
fn main() {
let parsed: i32 = "5".parse().unwrap();
let turbo_parsed = "10".parse::<i32>().unwrap();
let sum = parsed + turbo_parsed;
println!("Sum: {:?}", sum);
}