Answers for "golang check if character exists in string"

Go
3

check string contains golang

import (
    "strings"
)
strings.Contains("something", "some") // true
Posted by: Guest on August-01-2020
0

golang check if string exists in slice

func contains(s []int, e int) bool {
    for _, a := range s {
        if a == e {
            return true
        }
    }
    return false
}
Posted by: Guest on April-26-2022

Code answers related to "golang check if character exists in string"

Browse Popular Code Answers by Language