RosettaCodeData/Task/String-matching/Rust/string-matching-2.rust

8 lines
379 B
Text
Raw Permalink Normal View History

2017-09-23 10:01:46 +02:00
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"));
}