stringUtil.go 226 B

123456789
  1. package common
  2. import "sort"
  3. func IsSubString(target string, str_array []string) bool {
  4. sort.Strings(str_array)
  5. index := sort.SearchStrings(str_array, target)
  6. return index < len(str_array) && str_array[index] == target
  7. }