4 ms·
> You might want to slice the quotes off of a quoted string That's why I really like dealing with UTF-8. As you said you can just index by byte instead of hav
by Avernar 10y ago
> You might want to slice the quotes off of a quoted string
That's why I really like dealing with UTF-8. As you said you can just index by byte instead of having to worry about code point boundries. This is because a code point will never match inside a larger code point.
So if I search for a one byte quote character it will never match the second, third or fourth bytes in a larger code point. Same with other control characters.
Works when searching for 2 or 3 byte code points as well.