Slug: str-utf8-01 · Paired reading: Chapters 14 and 16
Prompt
fn nth_char(s: &str, n: usize) -> Option<char> — the n-th Unicode
scalar via chars().nth(n). Do not index with s[n] (byte index).
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? The landing page stays open — purchase unlocks this gym.
intermediate · order 89
Slug: str-utf8-01 · Paired reading: Chapters 14 and 16
fn nth_char(s: &str, n: usize) -> Option<char> — the n-th Unicode
scalar via chars().nth(n). Do not index with s[n] (byte index).