xstrings

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRC32 added in v1.8.0

func CRC32(v string) uint32

func Default added in v1.7.1

func Default(s, d string) string

Default 如果原值为空,返回默认值,否则使用默认值

func DefaultAfterTrim added in v1.7.1

func DefaultAfterTrim(s, d string) string

DefaultAfterTrim 对原字符串先trim,之后判定是否为空,如果为空则使用默认值,否则使用原值

func DefaultWithTrim added in v1.7.1

func DefaultWithTrim(s, d string) string

DefaultWithTrim 对原字符串先trim,之后判定是否为空。如果为空则使用默认值,否则使用trim后的原值

func EndsWith

func EndsWith(s, p string) bool

EndsWith 字符串s是否以p结尾

func Lcfirst

func Lcfirst(s string) string

Lcfirst 如果第一个字符在A-Z之间,则将其变为小写

func MD5

func MD5(v string) string

func MustInt

func MustInt(s string) int

func SHA1

func SHA1(v string) string

func SHA256

func SHA256(v string) string

func SHA256WithHMAC added in v1.8.0

func SHA256WithHMAC(v, k string) ([]byte, error)

func SHA256WithHMAC2Base64Str added in v1.8.0

func SHA256WithHMAC2Base64Str(v, k string) (string, error)

func SHA256WithHMAC2Hex added in v1.8.0

func SHA256WithHMAC2Hex(v, k string) (string, error)

func SHA512

func SHA512(v string) string

func SHA512384

func SHA512384(v string) string

func StartsWith

func StartsWith(s, p string) bool

StartsWith 字符串s是否以p开头

func ToFloat64Slice added in v1.3.0

func ToFloat64Slice(str string, separation string) []float64

func ToInt

func ToInt(s string) int

func ToIntSlice

func ToIntSlice(str string, separation string) []int

func ToNumberSlice added in v1.3.0

func ToNumberSlice[T types.Number](str string, separation string, to T) []T

func ToStringSlice

func ToStringSlice(str string, separation string) []string

func Ucfirst

func Ucfirst(s string) string

Ucfirst 如果第一个字符在a-z之间,则将其变为大写

Types

This section is empty.

Jump to

Keyboard shortcuts

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