sliceutil

package
v0.0.0-...-1fbfbf2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

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

Compare 比较两个slice的区别,即各自的差集,如果都为空,则相等

func Difference

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

Difference slice差集 - 属于slice1,不属于slice2

func DifferenceInterface

func DifferenceInterface(slice1, slice2 []interface{}) []interface{}

DifferenceInterface slice差集 - 属于slice1,不属于slice2

func DifferenceUint64

func DifferenceUint64(slice1, slice2 []uint64) []uint64

DifferenceUint64 slice差集 - 属于slice1,不属于slice2

func Explode

func Explode(sep string, s string) []string

Explode 别名 strings.Split

func Filter

func Filter(ss []string, filter ...func(s string) bool) []string

Filter slice过滤, 默认过滤空值

func Implode

func Implode(sep string, ss ...string) string

Implode 别名 strings.Join

func InSlice

func InSlice(s string, ss []string) bool

InSlice 判断字符串是否存在

func Intersect

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

Intersect slice交集

func IntersectInterface

func IntersectInterface(slice1, slice2 []interface{}) []interface{}

IntersectInterface slice交集

func IntersectUint64

func IntersectUint64(slice1, slice2 []uint64) []uint64

IntersectUint64 slice交集

func IsEmpty

func IsEmpty(ss []string) bool

IsEmpty 判断Slice是否为空

func Merge

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

Merge slice合并 - 不去重

func Pop

func Pop(ss *[]string) (string, bool)

Pop 尾出

func Push

func Push(s string, ss *[]string) int

Push 尾插 返回新切片元素个数

func Shift

func Shift(ss *[]string) (string, bool)

Shift 头出

func SplitByLen

func SplitByLen(s string, maxLen int) []string

SplitByLen 按照固定大小分割

func Union

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

Union slice并集

func UnionInterface

func UnionInterface(slice1, slice2 []interface{}) []interface{}

UnionInterface slice并集

func UnionUint64

func UnionUint64(slice1, slice2 []uint64) []uint64

UnionUint64 slice并集

func Unique

func Unique(ss []string) []string

Unique slice去重

func Unshift

func Unshift(s string, ss *[]string) int

Unshift 头插 返回新切片元素个数

Types

This section is empty.

Jump to

Keyboard shortcuts

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