In Go, iterating over a string using
for i := 0; i < len(myString); i++{
doSomething(myString[i])
}
only accesses individual bytes in the string, and iterating through the string through
for i, c := range myString{
doSomething(c)
}
iterates over individual Unicode code points (called runeGo), which can span multiple bytes.
My question is: how can I go forward iterating through a string using range Mystring? continuecan go forward with one unicode code, but itβs not possible to just do i += 3it if you want to jump forward at three code points. So, what would be the most idiomatic way of moving forward n code points?
I golang nuts, , . - , , " " , . .