Exercise 1 · Chapter: StringsRequired+50 XP
String Length
Create a String with the value "Rustacean" and print its length.
Expected output:
9
Hints:
- Use
String::from("Rustacean")to create the string - Use
.len()to get the length - Print the length with
println!
rust
fn main() {
}
Output
Run your code to see the output here.