small refactoring, using new util function tokenize instead of split in slash.lua

This commit is contained in:
Manuel Simon Hirsig
2016-06-06 11:04:24 +02:00
parent 4b1dab838c
commit 0e6a63a485
2 changed files with 23 additions and 15 deletions
+8
View File
@@ -334,6 +334,14 @@ function public.join(array, separator)
return str
end
function public.tokenize(str)
local tokens = {}
for token in string.gfind(str, '%S+') do
tinsert(tokens, token)
end
return tokens
end
function public.split(str, separator)
local array = {}