slice

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStr

func AppendStr(strs []string, str string) []string

AppendStr appends string to slice with no duplicates.

func CompareSliceStr

func CompareSliceStr(s1, s2 []string) bool

CompareSliceStr compares two 'string' type slices. It returns true if elements and order are both the same.

func CompareSliceStrU

func CompareSliceStrU(s1, s2 []string) bool

CompareSliceStrU compares two 'string' type slices. It returns true if elements are the same, and ignores the order.

func FindAddString

func FindAddString(old, now []string) (diff []string)

去重合并

func FindElement

func FindElement(arr []interface{}) (newArr []interface{})

func FindInt

func FindInt(old []int, now int) bool

指定查找

func FindSubString

func FindSubString(old []string, now string) (diff []string)

指定删除

func IfZero

func IfZero(arg interface{}) bool

判断一个值是否为零值,只支持string,float,int,time 以及其各自的指针,"%"和"%%"也属于零值范畴,场景是like语句

func IsSliceContainsInt64

func IsSliceContainsInt64(sl []int64, i int64) bool

IsSliceContainsInt64 returns true if the int64 exists in given slice.

func IsSliceContainsStr

func IsSliceContainsStr(sl []string, str string) bool

IsSliceContainsStr returns true if the string exists in given slice, ignore case.

func RemoveElement

func RemoveElement(arr []interface{}, elem interface{}) []interface{}

func RemoveInt

func RemoveInt(arr []int, elem int) []int

func RemoveRepeatedElement

func RemoveRepeatedElement(arr []interface{}) (newArr []interface{})

func RemoveRepeatedFloat64

func RemoveRepeatedFloat64(arr []float64) (newArr []float64)

func RemoveRepeatedInt

func RemoveRepeatedInt(arr []int) (newArr []int)

func RemoveRepeatedString

func RemoveRepeatedString(arr []string) (newArr []string)

func RemoveString

func RemoveString(arr []string, elem string) []string

func RemoveZero

func RemoveZero(slice []interface{}) []interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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