Answers for "rust from::string"

2

rustlang string

let mut hello = String::from("Hello, ");

hello.push('w');
hello.push_str("orld!");
Posted by: Guest on March-23-2021
1

rust into string

// You can convert a literal string (&str) into a String using the to_string function
// Here s is a String where s_literal is a &'static str
let s_literal = "String literal";
let s = s_literal.to_string();
Posted by: Guest on April-06-2021

Browse Popular Code Answers by Language