bob/util/util.go

20 lines
280 B
Go
Raw Normal View History

2021-06-24 07:43:28 +00:00
package util
func IsIn(arr []string, value string) bool {
for _, item := range arr {
if item == value {
return true
}
}
return false
}
func FindPosition(arr []string, value string) int {
for i, item := range arr {
if item == value {
return i
}
}
return -1
}