rust string to and str

233

rust string to &str -

let s: String = "abcdefg".to_owned();
let s_slice: &str = &s[..];  // take a full slice of the string

Comments

Submit
0 Comments