stringutil

package
v0.0.49-alpha.29 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Difference

func Difference(slice1, slice2 []int64) []int64

Get the diff of two slices

func DifferenceString

func DifferenceString(slice1, slice2 []string) []string

Get the diff of two slices

func FormatString added in v0.0.48

func FormatString(text string, length int, alignLeft bool) string

FormatString formats a string with a specified length and alignment. `text` is the input string to format. `length` is the desired length of the output string. `alignLeft` specifies whether the string should be left-aligned (true) or right-aligned (false).

func GetFuncName

func GetFuncName(skips ...int) string

func GetHashCode

func GetHashCode(s string) uint32

func GetSelfFuncName

func GetSelfFuncName() string

func Int32ToString

func Int32ToString(i int32) string

func Int64ToString

func Int64ToString(i int64) string

func IntToString

func IntToString(i int) string

func InterfaceArrayToStringArray

func InterfaceArrayToStringArray(data []any) (i []string)

func Intersect

func Intersect(slice1, slice2 []int64) []int64

Get the intersection of two slices

func IntersectString

func IntersectString(slice1, slice2 []string) []string

Get the intersection of two slices

func IsContain

func IsContain(target string, List []string) bool

judge a string whether in the string list

func IsContainInt

func IsContainInt(target int, List []int) bool

func IsContainInt32

func IsContainInt32(target int32, List []int32) bool

func IsDuplicateStringSlice

func IsDuplicateStringSlice(arr []string) bool

func RemoveDuplicate

func RemoveDuplicate[T comparable](arr []T) []T

func RemoveDuplicateElement

func RemoveDuplicateElement(idList []string) []string

func StringToInt

func StringToInt(i string) int

func StringToInt32

func StringToInt32(i string) int32

func StringToInt64

func StringToInt64(i string) int64

func StructToJsonBytes

func StructToJsonBytes(param any) []byte

func Uint32ToString

func Uint32ToString(i uint32) string

func WithMessage

func WithMessage(err error, message string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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