3x-ui/util/common/stringUtil.go

10 lines
226 B
Go
Raw Normal View History

2023-02-09 22:18:06 +03:00
package common
import "sort"
func IsSubString(target string, str_array []string) bool {
sort.Strings(str_array)
index := sort.SearchStrings(str_array, target)
return index < len(str_array) && str_array[index] == target
}