package main
import "fmt"
import "github.com/wxnacy/wgo/arrays"
//go get github.com/wxnacy/wgo/arrays 安装包
func main() {
str := "342"
var numbers []string
numbers = append(numbers, "3332", "342", "ssddd", "ssss", "%%%%")
index := arrays.ContainsString(numbers, str)
if index == -1 {
fmt.Printf("not exists") //-1说明不存在
} else {
fmt.Println(index) //存在则会返回元素的下标
}
}