Rust学习(12):slice

slice是String的一部分引用。类似切片。 文章目录 字符串slice 其他slice 字符串slice slice获取值的使用权但是没有得到值得所有权 fn main() { let s = String::from("Hello world"); let hello = &s[0..5]; //[start, end) let world = &s[6..11]
相关文章
相关标签/搜索