Re:Google App Engine for Go
by supersillyus on Tuesday May 10, 2011 @06:42PM
(#2534369)
Iteration over strings is rune-by-rune in Go. However, (somewhat counter-intuitively) string indexing/slicing is byte-by-byte, so you can't just go "str[0:10]" and get the first 10 code points. Then again, that's true in utf16 also, if I'm not mistaken.
But if you want an array of runes instead of a utf8 encoded string, you can just do "[]int(mystring)" and it'll do the conversion for you.
[ Parent
| on HN ]
There are no comments on this comment yet.