Documentation
¶
Overview ¶
Package lysstring contains string functions.
Index ¶
- func Camel(s string) (res string)
- func Convert(s, inSep, outSep string, f func(string) string) (res string)
- func DeAlias[T ~string](in []T) (out []string)
- func FirstLower(s string) string
- func IsAscii(s string) bool
- func Joined(s string) (res string)
- func Kebab(name string) (res string)
- func Pascal(s string) (res string)
- func RandString(n int) string
- func RemoveCharacters(input string, charsToRemove string) string
- func ReplaceAccents(s string) (res string, err error)
- func SingleLine(s string) string
- func SingleSpace(s string) string
- func Snake(s string) (res string)
- func Title(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Camel ¶ added in v0.1.48
Camel removes accents and spaces in s and converts it to camel case My string -> myString
func FirstLower ¶ added in v0.1.48
FirstLower changes the first character of s to lower case from https://stackoverflow.com/questions/75988064/make-first-letter-of-string-lower-case-in-golang
func IsAscii ¶ added in v0.1.23
IsAscii returns true if s only contains ASCII chars from https://stackoverflow.com/questions/53069040/checking-a-string-contains-only-ascii-characters
func Joined ¶ added in v0.1.48
Joined removes accents and spaces in s and converts it to lower case My string -> mystring
func Kebab ¶ added in v0.1.48
Kebab removes accents in s and changes it to lower case with hyphen separation My string -> my-string
func Pascal ¶ added in v0.1.48
Pascal removes accents and spaces in s and changes it to Pascal case My string -> MyString
func RandString ¶
RandString creates a random string of length n from https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go
func RemoveCharacters ¶ added in v0.1.14
RemoveCharacters returns input with the chars in charsToRemove removed from https://socketloop.com/tutorials/golang-remove-characters-from-string-example
func ReplaceAccents ¶ added in v0.1.23
ReplaceAccents replaces accent characters such as "é" with their non-accented equivalents such as "e" from https://twin.sh/articles/33/remove-accents-from-characters-in-go contains special handling for German accents
func SingleLine ¶ added in v0.1.49
SingleLines removes tabs and excess line breaks from s "a\n\n\tb\n" -> "a\nb" from https://stackoverflow.com/questions/35360080/golang-idiomatic-way-to-remove-a-blank-line-from-a-multi-line-string
func SingleSpace ¶ added in v0.1.49
SingleSpace removes excess tabs and spaces from s " a b " -> "a b" from https://stackoverflow.com/questions/37290693/how-to-remove-redundant-spaces-whitespace-from-a-string-in-golang
Types ¶
This section is empty.