Lua string parsing
I'm looking for a bit of help with parsing a string in Lua.
The pattern I've got is 4 numeric values separated by commas.
Something that look like "1, 2, 3, 4"
I want to split out each value into 4 separate local variables,
for example a, b, c, d.
It would be nice if the spaces between them were optional,
and something that could handle if less than 4 values are
present.
I haven't learned enough on parsing strings in Lua, so if
anyone can provide some help, I'd appreciate it.
|