summaryrefslogtreecommitdiff
path: root/script/utility.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/utility.lua')
-rw-r--r--script/utility.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/script/utility.lua b/script/utility.lua
index f06dd21e..004e8066 100644
--- a/script/utility.lua
+++ b/script/utility.lua
@@ -708,4 +708,12 @@ function m.getUpvalue(f, name)
return nil, false
end
+function m.stringStartWith(str, head)
+ return str:sub(1, #head) == head
+end
+
+function m.stringEndWith(str, tail)
+ return str:sub(-#tail) == tail
+end
+
return m