rust string to and str

240

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