diff options
Diffstat (limited to 'util/common/stringUtil.go')
| -rw-r--r-- | util/common/stringUtil.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/util/common/stringUtil.go b/util/common/stringUtil.go new file mode 100644 index 00000000..5f1f93fd --- /dev/null +++ b/util/common/stringUtil.go @@ -0,0 +1,9 @@ +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 +} |
