Back to Developer Roadmap

Iterating Strings

src/data/roadmaps/golang/content/iterating-strings@PC-azlCZ6wDCn1_nRyhUn.md

4.0690 B
Original Source

Iterating Strings

Iterate over strings with for range to get runes (Unicode code points) not bytes. Returns index and rune value. Direct indexing str[i] gives bytes. Use []rune(str) to convert to rune slice for random access. Important for Unicode handling.

Visit the following resources to learn more: