Exerpad
🔥 0
0 XP
Exercise 8 · Chapter: For LoopsOptional+50 XP

Reverse Word

Reverse the string "hello" and print the result.

Expected output:

olleh

Hints:

  • Use .chars().rev() to get the characters in reverse order
  • Use .collect::<String>() to turn the characters back into a string
  • let reversed: String = "hello".chars().rev().collect();
rust
fn main() {
}
Output
Run your code to see the output here.