Documentation
¶
Overview ¶
Package xstrings provides helpers for strings.
Index ¶
- func CompareIgnoreCase(a, b string) int
- func JoinsOrEmpty(elems []string, sep, empty string) string
- func Obfuscate(s string, n int, placeholder rune) string
- func RemoveMultiByte(s string) string
- func SanitizeFilename(s string) string
- func Title(s string) string
- func TruncateWithSuffix(s string, limit int, suffixLen int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareIgnoreCase ¶
CompareIgnoreCase works like strings.Compare, but is case insensitive.
func JoinsOrEmpty ¶
JoinsOrEmpty joins strings together like strings.Join, but returns a fallback when the elem slice is empty.
func Obfuscate ¶ added in v0.62.1
Obfuscate returns a new string of the same length as s with all characters replaced with a placeholder, except for the last n characters.
func RemoveMultiByte ¶ added in v0.70.0
RemoveMultiByte returns a new string where all multi-byte UTF-8 characters have been removed.
func SanitizeFilename ¶ added in v0.72.0
SanitizeFilename returns a copy of s usable as a file name on Windows, Unix, macOS and Android. Returns "_" if nothing usable remains.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.