1
2
3
4
5
6
7
8
9
10
11
fn main()
{
let s = String::from("hello world");

let h = &s[0..5];
let h =&s[0..=4];
let h = &s[..=4];
let h = &s[..5];
println!("h= {}",h);

}