strs

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat

func Concat(strs ...string) string

Concat

func EllipsisString

func EllipsisString(str string, length int) string

func EndsWith

func EndsWith(str string, suffix string) bool

EndsWith check if a string ends with a specified suffix.

func EndsWithAny

func EndsWithAny(str string, suffixes ...string) bool

EndsWithAny check if a string ends with any of an array of specified strings.

func EndsWithAnyIgnoreCase

func EndsWithAnyIgnoreCase(str string, suffixes ...string) bool

EndsWithAnyIgnoreCase check if a string ends with any of an array of specified strings (ignoring case).

func EndsWithIgnoreCase

func EndsWithIgnoreCase(str string, suffix string) bool

EndsWithIgnoreCase case insensitive check if a string ends with a specified suffix.

func FirstLetter added in v0.3.8

func FirstLetter(name string) string

func Hash32

func Hash32(str string) uint32

func HashSHA1

func HashSHA1(str string) string

func IsAllLowerCase

func IsAllLowerCase(str string) bool

IsAllLowerCase checks if the string contains only lowercase characters.

func IsAllUpperCase

func IsAllUpperCase(str string) bool

IsAllUpperCase checks if the string contains only uppercase characters.

func IsAlpha

func IsAlpha(str string) bool

IsAlpha checks if the string contains only Unicode letters.

func IsAlphaSpace

func IsAlphaSpace(str string) bool

IsAlphaSpace checks if the string contains only Unicode letters and spaces.

func IsAlphanumeric

func IsAlphanumeric(str string) bool

IsAlphanumeric checks if the string contains only Unicode letters and digits.

func IsAlphanumericSpace

func IsAlphanumericSpace(str string) bool

IsAlphanumericSpace checks if the string contains only Unicode letters, digits and spaces.

func IsAnyBlank

func IsAnyBlank(strings ...string) bool

IsAnyBlank checks if any one of the strings are empty or containing only whitespaces.

func IsAnyEmpty

func IsAnyEmpty(strings ...string) bool

IsAnyEmpty checks if any one of the given strings are empty.

func IsBlank

func IsBlank(s string) bool

IsBlank checks if a string is whitespace or empty

func IsEmpty

func IsEmpty(s string) bool

IsEmpty checks if a string is empty.

func IsLetter

func IsLetter(ch rune) bool

func IsNoneBlank

func IsNoneBlank(strings ...string) bool

IsNoneBlank checks if none of the strings are empty or containing only whitespaces.

func IsNoneEmpty

func IsNoneEmpty(strings ...string) bool

IsNoneEmpty checks if none of the strings are empty.

func IsNotBlank

func IsNotBlank(s string) bool

IsNotBlank checks if a string is not empty or containing only whitespaces.

func IsNotEmpty

func IsNotEmpty(s string) bool

IsNotEmpty checks if a string is not empty.

func IsNullOrEmpty added in v0.3.11

func IsNullOrEmpty(val string) bool

func IsNumeric

func IsNumeric(str string) bool

IsNumeric checks if the string contains only digits.

func IsNumericSpace

func IsNumericSpace(str string) bool

IsNumericSpace checks if the string contains only digits and whitespace.

func IsWhitespace

func IsWhitespace(str string) bool

IsWhitespace checks if the string contains only whitespace.

func Join

func Join(a []string, sep string) string

Join joins an array of strings into a string where each item of the array is separated with a separator.

func JoinBool

func JoinBool(a []bool, sep string) string

JoinBool is the same as Join but joining boolean.

func JoinFloat64

func JoinFloat64(a []float64, sep string) string

JoinFloat64 is the same as Join but joining float64. The default format given to strconv.FormatFloat is 'G' and bitSize is 32.

func JoinFloat64WithFormatAndPrecision

func JoinFloat64WithFormatAndPrecision(a []float64, fmt byte, precision int, sep string) string

JoinFloat64WithFormatAndPrecision is the same as Join but joining float64 with a custom precision (bitSize) and format.

func JoinInt

func JoinInt(a []int, sep string) string

JoinInt is the same as Join but joining integers.

func JoinInt64

func JoinInt64(a []int64, sep string) string

JoinInt64 is the same as Join but joining int64.

func JoinUint64

func JoinUint64(ints []uint64, sep string) string

JoinUint64 is the same as Join but joining uint64.

func Left

func Left(str string, size int) string

Left gets the leftmost len characters of a string.

func StartsWith

func StartsWith(str string, prefix string) bool

StartsWith check if a string starts with a specified prefix.

func StartsWithAny

func StartsWithAny(str string, prefixes ...string) bool

StartsWithAny check if a string starts with any of an array of specified strings.

func StartsWithAnyIgnoreCase

func StartsWithAnyIgnoreCase(str string, prefixes ...string) bool

StartsWithAnyIgnoreCase check if a string starts with any of an array of specified strings (ignoring case).

func StartsWithIgnoreCase

func StartsWithIgnoreCase(str string, prefix string) bool

StartsWithIgnoreCase case insensitive check if a string starts with a specified prefix.

func Trim

func Trim(str string) string

Trim removes control characters from both ends of this string.

func TruncateString

func TruncateString(str string, limit int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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