summaryrefslogtreecommitdiff
path: root/str_utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'str_utils.lua')
-rw-r--r--str_utils.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/str_utils.lua b/str_utils.lua
new file mode 100644
index 0000000..c45f16a
--- /dev/null
+++ b/str_utils.lua
@@ -0,0 +1,12 @@
+local function split(inputstr, sep)
+ if sep == nil then
+ sep = "%s"
+ end
+ local t = {}
+ for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
+ table.insert(t, str)
+ end
+ return t
+end
+
+return { split = split }