strutil

package
v0.0.0-...-2d0e9f7 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NULL           = "null"
	Undefind       = "undefined"
	MoreInfoTarget = "..."
)

Variables

This section is empty.

Functions

func Contains

func Contains(str, substr string, ignoreCase bool) bool

------ contains

func CutByMax

func CutByMax(str string, max int) string

func EmptyToDefault

func EmptyToDefault(str, defaultStr string) string

EmptyToDefault Check if a string is empty ,if it's empty ,set a default value.

func HasEmpty

func HasEmpty(strs ...string) bool

HasEmpty Check if has empty string in the array of string.

func HasSpace

func HasSpace(strs ...string) bool

HasSpace Check if has Space string in the array of string. is equivalent to : IsSpace(...) || IsSpace(...) || ...

func IsAllEmpty

func IsAllEmpty(strs ...string) bool

IsAllEmpty Check if all string is empty

func IsAllNotEmpty

func IsAllNotEmpty(strs ...string) bool

IsAllNotEmpty Check if all of strs is Empty.

func IsAllNotSpace

func IsAllNotSpace(strs ...string) bool

IsAllNotSpace Check if all of strs is Space.

func IsAllSpace

func IsAllSpace(strs ...string) bool

IsAllSpace Check if all string is Space IsAllSpace is equivalent to : IsSpace(...) && IsSpace(...) && ...

func IsEmpty

func IsEmpty(str string) bool

IsEmpty Check if a string is empty. Empty means 1. "" 2. len(str) == 0 E.g: 1. IsEmpty("") == true 2. IsEmpty(" ") == false 3. IsEmpty(" \n \t \r") = false

IsEmpty can't check blank string.Check blank string should use IsBlank

func IsEmptyOrUnderfined

func IsEmptyOrUnderfined(str string) bool

func IsEndWith

func IsEndWith(str, suffix string, ignoreCase bool) bool

func IsEndWithAny

func IsEndWithAny(str string, ignoreCase bool, suffixs ...string) bool

func IsNotEmpty

func IsNotEmpty(str string) bool

IsNotEmpty Check if a string is not empty

func IsNotSpace

func IsNotSpace(str string) bool

IsNotSpace Check if a string is not Space

func IsNullOrUnderfined

func IsNullOrUnderfined(str string) bool

isNullOrUnderfined Check if str is null or undefined

func IsSpace

func IsSpace(str string) bool

IsBlankIfStr Check if a interface{} is string and if this string is blank.

func IsSpaceOrUnderfined

func IsSpaceOrUnderfined(str string) bool

func IsStartWith

func IsStartWith(str, prefix string, ignoreCase bool) bool

IsStartWith Checks if the str starts with a prefix ignoreCase ,Indicates whether case is ignored

func IsStartWithAny

func IsStartWithAny(str string, ignoreCase bool, prefixes ...string) bool

func SpaceToDefault

func SpaceToDefault(str, defaultStr string) string

SpaceToDefault Check if a string is Space ,if it's Space ,set a default value.

func ToSymbolCase

func ToSymbolCase(str string, symbol byte) string

func ToUnderLineCase

func ToUnderLineCase(str string) string

func TrimSpace

func TrimSpace(str string) string

TrimSpace Removes space char at the beginning and end of the string

func TrimSpaceLeft

func TrimSpaceLeft(str string) string

TrimSpaceLeft Removes space char at the beginning of the string

func TrimSpaceRight

func TrimSpaceRight(str string) string

TrimSpaceRight Removes space char at the end of the string

Types

This section is empty.

Jump to

Keyboard shortcuts

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