Obviously the above function does not work and I'm extremely simple minded at regex, can anyone put me in the right direction for simply splitting at a colon and referencing the first and second values?Code:webrequests.EnqueueGet( url, function(code, response) command, args = response:match("([^:]+),([^:]+)") print(command) print(args) end, self.Object)
An example in PHP would be
Moving on to next issue: http://oxidemod.org/threads/no-access-to-hooks.6709/Code:list($command, $args) = explode(":", response);
Solved Splitting strings
Discussion in 'Rust Development' started by TrustZan, Feb 5, 2015.
-
Code:
local function split(str, sep) local tbl = {} for word in string.gmatch(str, "[^"..sep.."]+") do table.insert(tbl, word) end return tbl endlocal string = "this is:your string" local splitted = split(string, ":")-- output for key, value in pairs(splitted) do print(key, value) end