String matching: Difference between revisions

(→‎TXR Lisp: Use starts-with, ends-with and iflet.)
Line 2,785:
}</lang>
 
<lang rust>
fn main(){
let hello = String::from("Hello word");
println!(" Start with \"he\" {} \n Ends with \"rd\" {}\n Contains \"wi\" {}",
hello.starts_with("He"),
hello.ends_with("rd"),
hello.contains("wi"));
}</lang>
 
{{out}}
Start with "he" true
Ends with "rd" true
Contains "wi" false
{{out}}
 
=={{header|Scala}}==
Anonymous user