mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-28 11:39:17 +00:00
Move the includes/install to resources/install
This commit is contained in:
11
resources/install/scripts/resources/functions/explode.lua
Normal file
11
resources/install/scripts/resources/functions/explode.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
--add the explode function
|
||||
function explode ( seperator, str )
|
||||
local pos, arr = 0, {}
|
||||
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
|
||||
table.insert( arr, string.sub( str, pos, st-1 ) ) -- attach chars left of current divider
|
||||
pos = sp + 1 -- jump past current divider
|
||||
end
|
||||
table.insert( arr, string.sub( str, pos ) ) -- attach chars right of last divider
|
||||
return arr
|
||||
end
|
||||
Reference in New Issue
Block a user