Implement missing string ops
quasilyte opened this issue · 3 comments
quasilyte commented
Operations:
s[index] -> nth string byte
len(s) -> string byte length
for K, V := range s
-> K is byteN
-> V is rune
Possible representations:
- unibyte strings. Easier to implement
s[index]
, harder to implementfor/range
. - multibyte strings. Easier to implement
for/range
, harder to implements[index]
- vector of chars. Like unibyte strings, but can be less efficient
quasilyte commented
Useful blog entry: http://nullprogram.com/blog/2014/06/13/
Asked a question at https://emacs.stackexchange.com/questions/33970/get-multibyte-string-byte
quasilyte commented
Still missing:
[]byte(string)
conversion- for/range over string