Exercise 4 · Chapter: StringsRequired+50 XP
Contains Check
Create a string "I love Rust programming" and check if it contains the word "Rust". Print true if it does, or false if it doesn't.
Expected output:
true
Hints:
- Use
.contains("Rust")to check if the text is inside the string println!("{}", some_bool)printstrueorfalse
rust
fn main() {
}
Output
Run your code to see the output here.