RosettaCodeData/Task/String-matching/Rust/string-matching-2.rust
2017-09-25 22:28:19 +02:00

7 lines
379 B
Text

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"));
}