Complete the code to create a new empty String in Rust.
let mut s = String::[1]();The String::new() function creates a new empty String in Rust.
Complete the code to add the text "hello" to the String variable s.
s.[1]("hello");
The push_str method appends a string slice to a String.
Fix the error in the code to convert a &str to a String.
let s = "hello".[1]();
The to_string() method converts a string slice (&str) to a String.
Fill both blanks to create a String from a &str and then get its length.
let s = String::[1]("hello"); let length = s.[2]();
String::from("hello") creates a String from a string slice.len() returns the length of the String.
Fill all three blanks to create a String, append text, and print it.
let mut s = String::[1](); s.[2](" world"); println!("{}", s[3]);
String::new() creates an empty String.push_str(" world") appends text..as_str() converts String to &str for printing.
