Start learning free

LESSON 61 OF 348 · STRINGS I

Updating Strings in Rust in Rust

Lesson

This guided lesson fixes a misspelled name using Rust character collection syntax.


What you will build:

  1. Convert the string to characters, replace the first character with 'A', and collect the characters back into name.

Starter code:

let mut name = "bndrei Chiriac".to_string();

Assignment
Follow the Coding Tutorial and complete the Rust step.

STEP 1 OF 1
    Ctrl + Enter to check

    Updating Strings in Rust

    Keep going with RustAbout 340 step-by-step lessons, from your first line of code to coding interviews. Free to start.
    Start learning free