You can use .join on a vector to join together a vector of strings, if you have an iterator you may collect it before using .join
xxxxxxxxxx
fn main() {
let string_list = vec!["Foo".to_string(),"Bar".to_string()];
let joined = string_list.join("-");
assert_eq!("Foo-Bar", joined);
}
xxxxxxxxxx
fn main() {
let mut string = String::from("Hello");
string.push_str(" World");
println!("{}", string);
}
xxxxxxxxxx
let text1 = "hello".to_owned();
let text2 = text1 + " world";
println!("{}", text2);