Documentation ¶
Index ¶
- func DefaultIfBlank(str, def string) string
- func Equals(a, b string) bool
- func EqualsIgnoreCase(a, b string) bool
- func GetHtmlText(html string) string
- func GetSummary(s string, length int) string
- func IsAnyBlank(strs ...string) bool
- func IsBlank(str string) bool
- func IsEmpty(str string) bool
- func IsNotBlank(str string) bool
- func IsNotEmpty(str string) bool
- func RuneLen(s string) int
- func Substr(s string, start, length int) string
- func ToCamel(s string) string
- func ToDelimited(s string, del uint8) string
- func ToInt(str string) int
- func ToInt64(str string) int64
- func ToInt64ByDefault(str string, def int64) int64
- func ToIntByDefault(str string, def int) int
- func ToKebab(s string) string
- func ToLowerCamel(s string) string
- func ToScreamingDelimited(s string, del uint8, screaming bool) string
- func ToScreamingKebab(s string) string
- func ToScreamingSnake(s string) string
- func ToSnake(s string) string
- func UUID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIfBlank ¶
func EqualsIgnoreCase ¶
func IsAnyBlank ¶
func IsBlank ¶
IsBlank checks if a string is whitespace or empty (""). Observe the following behavior:
goutils.IsBlank("") = true goutils.IsBlank(" ") = true goutils.IsBlank("bob") = false goutils.IsBlank(" bob ") = false
Parameter:
str - the string to check
Returns:
true - if the string is whitespace or empty ("")
func IsEmpty ¶
IsEmpty checks if a string is empty (""). Returns true if empty, and false otherwise.
func IsNotBlank ¶
func IsNotEmpty ¶
func ToDelimited ¶
Converts a string to delimited.snake.case (in this case `del = '.'`)
func ToInt64ByDefault ¶ added in v0.0.3
ToInt64ByDefault str to int64 str 字符串 def 如果转换失败使用的默认值
func ToIntByDefault ¶ added in v0.0.3
ToIntByDefault str to int str 字符串 def 如果转换失败使用的默认值
func ToScreamingDelimited ¶
Converts a string to SCREAMING.DELIMITED.SNAKE.CASE (in this case `del = '.'; screaming = true`) or delimited.snake.case (in this case `del = '.'; screaming = false`)
func ToScreamingKebab ¶
Converts a string to SCREAMING-KEBAB-CASE
func ToScreamingSnake ¶
Converts a string to SCREAMING_SNAKE_CASE
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.