Documentation ¶
Overview ¶
Package strutil implements some functions to manipulate string.
Index ¶
- func After(s, char string) string
- func AfterLast(s, char string) string
- func Before(s, char string) string
- func BeforeLast(s, char string) string
- func CamelCase(s string) string
- func Capitalize(s string) string
- func IsString(v interface{}) bool
- func KebabCase(s string) string
- func LowerFirst(s string) string
- func PadEnd(source string, size int, padStr string) string
- func PadStart(source string, size int, padStr string) string
- func Reverse(s string) string
- func SnakeCase(s string) string
- func SplitEx(s, sep string, removeEmptyString bool) []string
- func Unwrap(str string, wrapToken string) string
- func UpperFirst(s string) string
- func Wrap(str string, wrapWith string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeforeLast ¶
BeforeLast create substring in source string before position when char last appear
func Capitalize ¶
Capitalize converts the first character of a string to upper case and the remaining to lower case.
func IsString ¶
func IsString(v interface{}) bool
IsString check if the value data type is string or not.
func LowerFirst ¶
LowerFirst converts the first character of string to lower case.
func PadEnd ¶
PadEnd pads string on the right side if it's shorter than size. Padding characters are truncated if they exceed size.
func PadStart ¶
PadStart pads string on the left side if it's shorter than size. Padding characters are truncated if they exceed size.
func Reverse ¶ added in v1.3.2
Reverse return string whose char order is reversed to the given string
func SplitEx ¶ added in v1.3.0
SplitEx split a given string whether the result contains empty string
func UpperFirst ¶ added in v1.2.2
UpperFirst converts the first character of string to upper case.
Types ¶
This section is empty.