say I have an utf-8 encoded string that I want to truncate to a certain number of bytes.
So I am looking for the longest substring that - when encoded as utf-8 takes less than a certain number of bytes.
What is the best way to do this?
Many thanks!
In reply to truncate string to byte count by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |