strcase

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultIfBlank

func DefaultIfBlank(str, def string) string

func Equals

func Equals(a, b string) bool

func EqualsIgnoreCase

func EqualsIgnoreCase(a, b string) bool

func GetHtmlText

func GetHtmlText(html string) string

GetHtmlText 获取html文本

func GetSummary

func GetSummary(s string, length int) string

GetSummary 获取summary

func IsAnyBlank

func IsAnyBlank(strs ...string) bool

func IsBlank

func IsBlank(str string) bool

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

func IsEmpty(str string) bool

IsEmpty checks if a string is empty (""). Returns true if empty, and false otherwise.

func IsNotBlank

func IsNotBlank(str string) bool

func IsNotEmpty

func IsNotEmpty(str string) bool

func RuneLen

func RuneLen(s string) int

RuneLen 字符成长度

func Substr

func Substr(s string, start, length int) string

截取字符串

func ToCamel

func ToCamel(s string) string

Converts a string to CamelCase

func ToDelimited

func ToDelimited(s string, del uint8) string

Converts a string to delimited.snake.case (in this case `del = '.'`)

func ToKebab

func ToKebab(s string) string

Converts a string to kebab-case

func ToLowerCamel

func ToLowerCamel(s string) string

Converts a string to lowerCamelCase

func ToScreamingDelimited

func ToScreamingDelimited(s string, del uint8, screaming bool) string

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

func ToScreamingKebab(s string) string

Converts a string to SCREAMING-KEBAB-CASE

func ToScreamingSnake

func ToScreamingSnake(s string) string

Converts a string to SCREAMING_SNAKE_CASE

func ToSnake

func ToSnake(s string) string

Converts a string to snake_case

func UUID

func UUID() string

UUID

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL