Documentation ¶
Overview ¶
Package strings contains utilities for working with strings in Go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TruncateUTF8 ¶
TruncateUTF8 truncates the given string to make sure it uses less than limit bytes. If the last code point is an utf8 code point that would be split, it removes it entirely to make sure the resulting string is not broken.
This function may still split characters that are comprised of more than one valid utf8 code point, like many emoji, however the resulting string will still be valid utf8. Example: The "Flag: United States emoji" is a flag sequence combining
🇺 Regional Indicator Symbol Letter U 🇸 Regional Indicator Symbol Letter S
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.