Documentation ¶
Overview ¶
Package slice contains methods for slice conversion and modification
Index ¶
- func ContainsInt(a int, list []int) bool
- func ContainsString(a string, list []string) bool
- func ConvertStringToFloat(slice []string) []float64
- func ConvertStringToInt(slice []string) []int
- func Dict(slice []string) map[string]bool
- func DictInt(slice []int) map[int]bool
- func Diff(sliceA, sliceB []string) []string
- func HasIntersect(sliceA, sliceB []string) bool
- func IndexOfString(str string, s []string) int
- func Intersect(sliceA, sliceB []string) []string
- func JoinInts(intSlice []int, sep string) string
- func SomeFloat(slice []float64, f func(float64) bool) bool
- func SortStringsCaseInsensitive(inputSlice []string) []string
- func UniqueInts(slice []int) []int
- func UniqueStrings(slice []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsInt ¶
ContainsInt checks if an int is found in a slice of ints.
func ContainsString ¶
ContainsString checks if a string is found in a slice of strings.
func ConvertStringToFloat ¶
ConvertStringToFloat converts a slice of strings to a slice of float64.
func ConvertStringToInt ¶
ConvertStringToInt converts a slice of strings to a slice of ints.
func HasIntersect ¶
HasIntersect determines if two string slices share any element.
func IndexOfString ¶
IndexOfString returns the index of a value in a slice.
func SomeFloat ¶
SomeFloat evaluates a slice of floats []float64 and returns true if any member passes the provided function.
func SortStringsCaseInsensitive ¶
SortStringsCaseInsensitive sorts a slice of strings ignoring case.
func UniqueInts ¶
UniqueInts returns only the unique values in a slice of ints.
func UniqueStrings ¶
UniqueStrings returns only the unique values in a slice of strings.
Types ¶
This section is empty.