RosettaCodeData/Task/String-matching/Rust/string-matching-2.rs
2024-10-16 18:07:41 -07:00

7 lines
379 B
Rust

fn main(){
let hello = String::from("Hello world");
println!(" Start with \"he\" {} \n Ends with \"rd\" {}\n Contains \"wi\" {}",
hello.starts_with("He"),
hello.ends_with("ld"),
hello.contains("wi"));
}