Mohamed Elsherif

17%
Flag icon
But this is clumsy, and we need loops of this kind all the time. Fortunately, Go’s range loop, when applied to a string, performs UTF-8 decoding implicitly. The output of the loop below is also shown in Figure 3.5; notice how the index jumps by more than 1 for each non-ASCII rune.
The Go Programming Language
Rate this book
Clear rating
Open Preview