summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/str.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/str.go b/lib/str.go
index bc25e2d..8211ea8 100644
--- a/lib/str.go
+++ b/lib/str.go
@@ -131,3 +131,13 @@ func StrToUpper(s string) string {
}
return us
}
+
+// Returns true if string 's' has string 'n' in it.
+func StrHas(s, n string) bool {
+ for i := 0; i < len(s); i++ {
+ if s[i:i+len(n)] == n {
+ return true
+ }
+ }
+ return false
+}