Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Replace Word

Start with the sentence "I like cats" and replace "cats" with "dogs". Print the new sentence.

Expected output:

text
I like dogs

Hints:

  • Use .replace("old", "new") to swap text
  • .replace() gives you a new string — print that!
rust
fn main() {
}