Documentation
¶
Index ¶
- func CP1258ToUTF8(txt []byte) (utf8Txt string)
- func CamelCase(str string) string
- func HTMLToText(html string) (text string)
- func KebabCase(str string) string
- func PascalCase(str string) string
- func RandomString(n int) (str string)
- func SanitizeText(txt string) (newTxt string)
- func Shorten(str string, length int, appendStr string) (shorter string)
- func Slug(str string) string
- func SnakeCase(str string) string
- func SpecialCharsToStandard(str string) string
- func StringInSlice(searchStr string, strs []string) bool
- func UnCase(str string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CP1258ToUTF8 ¶
CP1258ToUTF8 converts a CP1258 byte array to a UTF-8 string.
func HTMLToText ¶
HTMLToText converts HTML to standard text.
func PascalCase ¶
PascalCase will convert a string to PascalCase. This is the same as camelCase, but with the first letter capitalized.
func RandomString ¶
RandomString creates a secure pseudorandom string using the crypto rand package.
func SanitizeText ¶
TextSanitizer converts HTML to standard text, but also replaces some special chars and escapings.
func Shorten ¶
Shorten tries to create the most sensible (to a human) shortened text. If possible, it will try to cut at a non-word char. It will strip newlines and carriage returns.
func Slug ¶
Slug will convert a string to a slug. It will also do transliteration of non-ascii chars.
func SpecialCharsToStandard ¶
SpecialCharsToStandard replaces all kinds of non-ascii chars with transliterations.
func StringInSlice ¶
StringInSlice will check if a string is in a slice and return true if it is.
Types ¶
This section is empty.