So this is really more of a basic question than a wow ace question. I just feel more comfortable asking it here than the wow forums though, cause well... Not many people respond there that know LUA conventions :)
I'm trying to pull a single return value from strmatch, but just can't wrap my brain around how to do this.. Example
Any hints on how to return a specific index in this case?
if the match string is a variable/constant then either use select as already mentioned or use some random throwaway variable like the underscore for returns you dont care about;
_, _, z = strmatch("Something", "S(%a)m(%a)th(%a)ng")
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to pull a single return value from strmatch, but just can't wrap my brain around how to do this.. Example
this works great if I want to assign variables, but what If I want to keep my match string intact and only return the 3rd instance of my match?
I'd like to do something LIKE
and have it return 'i'
Any hints on how to return a specific index in this case?
http://www.lua.org/pil/5.2.html
if the match string is a variable/constant then either use select as already mentioned or use some random throwaway variable like the underscore for returns you dont care about;
_, _, z = strmatch("Something", "S(%a)m(%a)th(%a)ng")