HasString checks if a string slice contains a target string
(list []string, query string)
| 25 | |
| 26 | // HasString checks if a string slice contains a target string |
| 27 | func HasString(list []string, query string) bool { |
| 28 | for _, elem := range list { |
| 29 | if elem == query { |
| 30 | return true |
| 31 | } |
| 32 | } |
| 33 | return false |
| 34 | } |
| 35 | |
| 36 | // HasAnyStrings checks if a string slice contains any string from the query string slice |
| 37 | func HasAnyStrings(queries []string, list []string) bool { |
no outgoing calls