rust substring
#rust
code:rust
let text = "忠犬ハチ公".to_string();
let sub: String = text.chars().take(3).collect();
println!("{}", sub); // => "忠犬ハ"