From b73e4173a3c1e69e02ad6b4e3b43e425e57a5be9 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Thu, 9 Feb 2023 22:48:06 +0330 Subject: 3x-ui --- util/common/stringUtil.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 util/common/stringUtil.go (limited to 'util/common/stringUtil.go') 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 +} -- cgit v1.2.3