Minty23185Fresh
January 20th, 2019, 17:32
Is there a way to capture the results of string.match() into a table instead of a series of variables?
Instead of this:
local var1, var2, var3 = string.match(sData, sCapture);
yielding, say, this
var1 = "Fred", var2 = 3.14159, var3 = "<h>Aliens</h>"
Something like this:
local myTable = { };
myTable = totable(string.match(sData, sCapture));
which yields
myTable = { "Fred", 3.14159, "<h>Aliens</h>" }
I realize "totable()" doesn't exist and that the syntax is goofy, but I'm trying to illustrate my point as best that I can
Instead of this:
local var1, var2, var3 = string.match(sData, sCapture);
yielding, say, this
var1 = "Fred", var2 = 3.14159, var3 = "<h>Aliens</h>"
Something like this:
local myTable = { };
myTable = totable(string.match(sData, sCapture));
which yields
myTable = { "Fred", 3.14159, "<h>Aliens</h>" }
I realize "totable()" doesn't exist and that the syntax is goofy, but I'm trying to illustrate my point as best that I can