fn main() { let name = "Alice"; let age = 30; let json = format!(r#"{{"name":"{}","age":{}}}"#, name, age); println!("{}", json); }
Output
Click Run to execute, or Check to validate.
Ask questions or share tips about this tutorial
Sign in to join the discussion