Documentation
¶
Overview ¶
Package stringutil provides common string manipulation utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Truncate ¶
Truncate truncates a string to maxLen characters and adds "..." if truncated. If the string is shorter than or equal to maxLen, it returns the original string.
func TruncateMiddle ¶
TruncateMiddle truncates a string in the middle, preserving the beginning and end. This is useful for URLs where both the domain and the endpoint are important. Example: "https://api.example.com/v1/users/12345" -> "https://api.example...rs/12345"
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.