4 ms·
> substrings are mutable Are you sure? I know that a byte slice []byte is mutable, but I thought slicing a string yielded a string (and strings are immutable),
by masklinn 12y ago
> substrings are mutable
Are you sure? I know that a byte slice []byte is mutable, but I thought slicing a string yielded a string (and strings are immutable), an explicit conversion (and copy) is needed to get the underlying byte slice.
- pcwalton 12y agoOh yes, my mistake, they're immutable. I was thinking of []byte.