CollectionFunctions

package
v0.0.0-...-a287a10 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(vs []string, f func(string) bool) bool

All returns `true` if all of the strings in the slice satisfy the predicate `f`.

func Any

func Any(vs []string, f func(string) bool) bool

Any returns `true` if one of the strings in the slice satisfies the predicate `f`.

func Filter

func Filter(vs []string, f func(string) bool) []string

Filter returns a new slice containing all strings in the slice that satisfy the predicate `f`.

func Include

func Include(vs []string, t string) bool

Include returns `true` if the target mystring t is in the slice.

func Index

func Index(vs []string, t string) int

Index returns the first index of the target mystring `t`, or -1 if no match is found.

func Map

func Map(vs []string, f func(string) string) []string

Map returns a new slice containing the results of applying the function `f` to each mystring in the original slice.

func TestCollectionFunctions

func TestCollectionFunctions()

其实就是strings包

Types

This section is empty.

Jump to

Keyboard shortcuts

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