Documentation ¶
Index ¶
- func And(s ...string) string
- func DeleteWhitespace(s string) string
- func FromInt(i int) string
- func Head(s string) string
- func IndexAfter(s, sep string) int
- func Init(s string) string
- func IsBlank(s string) bool
- func IsEmpty(s string) bool
- func Last(s string) string
- func Lines(s string) []string
- func LowerFirst(s string) string
- func Or(s ...string) string
- func Reverse(s string) (rev string)
- func ShrinkWhitespace(s string) string
- func Surround(s, around string) string
- func Tail(s string) string
- func Take(s string, n int) string
- func TakeAfter(s, pattern string) string
- func TakeBefore(s, pattern string) string
- func TakeRight(s string, n int) string
- func TakeRightAfter(s, pattern string) string
- func TakeRightBefore(s, pattern string) string
- func ToInt(s string) (int, error)
- func Truncate(s string, n int, suffix ...string) string
- func UpperFirst(s string) string
- func WordWrap(s string, width int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteWhitespace ¶
DeleteWhitespace returns a version of the passed-in string with all whitespaces (as by unicode.IsSpace) removed.
func IndexAfter ¶
IndexAfter returns the index directly after the first instance of sep in s, or -1 if sep is not present in s.
func LowerFirst ¶
LowerFirst returns str with the first char lower-cased.
func ShrinkWhitespace ¶
ShrinkWhitespace returns a version of the passed-in string with whitespace removed from the end and beginning as well as all whitespace in-between shrunken to a single space.
func Take ¶
Take returns a substring of the first n elements. If n is greater than the length of th string, the whole string is returned.
func TakeAfter ¶
TakeAfter searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.
func TakeBefore ¶
TakeBefore searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.
func TakeRight ¶
TakeRight returns a substring of the last n elements. If n is greater than the length of the string, the whole string is returned.
func TakeRightAfter ¶
TakeRightAfter searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.
func TakeRightBefore ¶
TakeRightBefore searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.
func Truncate ¶
Truncate returns a substring of the first n elements and appends a suffix ("..." by default) to the result.
If the suffix is longer than the truncated part, the original string is returned.
func UpperFirst ¶
UpperFirst returns str with the first char upper-cased.
Types ¶
This section is empty.