Answers for "golang check if in array"

Go
1

golang check if in array

func stringInSlice(a string, list []string) bool {
    for _, b := range list {
        if b == a {
            return true
        }
    }
    return false
}
Posted by: Guest on July-02-2021

Browse Popular Code Answers by Language