StringsString Slicing & UTF-8 Boundaries
All courses

Slice by byte index — carefully

String slicing uses byte indices, not character indices. Slicing mid-UTF8-character panics. Use .chars() for Unicode-aware iteration.

Best practice: Prefer library helpers over manual byte slicing for user-facing text.

Output
Press Run to execute your code.