sliceT

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainStr

func ContainStr(val string, valueList []string) bool

判断字符串是否在列表中

func Filter

func Filter[T comparable](slice []T, condition func(T) bool) []T

切片过滤

func GetIndex added in v0.1.4

func GetIndex[T comparable](val T, stringsSlice []T) int

判断字符串在列表中的位置

func IsEmpty

func IsEmpty(array []string) bool

判断切片是否为空

func StringInSlice

func StringInSlice[T comparable](val T, stringsSlice []T) bool

全等

func StringInSliceA

func StringInSliceA(val string, stringsSlice []string) bool

传入的 val 应该是比较短的部分 如 六安市 In ["安徽省六安市“] True

func StringInSliceB

func StringInSliceB(val string, stringsSlice []string) bool

传入的 val 应该是比较长的 如 安徽省六安市 In [”六安市“] True

func ToSet

func ToSet[T comparable](strings []T) []T

去重函数 - 变成集合

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳