rust string concatenation code example
Example 1: how to concatenate two &str in rust
// using 2 variables
let new_string = format!("{}{}", first_string, second_string);
// using 2 literals
let new_string = format!("{}{}", "first string ", "second string");
Example 2: rust concatenate strings
let text1 = "hello".to_owned();
let text2 = text1 + " world";
println!("{}", text2);
Example 3: string concatenation js
var aString="";
aString.concat(value1, value2, ... value_n);