Lua string.find() question
I recall reading up on Lua string functions but oddly, I never noticed the discrepancy until this morning.
I noticed that the return values from string.find() were being assigned to 4 variables. Looked again and saw it is indicated (in the search results I hit) that find() returns start and end of match only. Two values. All the examples show this and how to then user string.sub() to get the contents of the match.
But obviously, if you print the following:
Debug.console(string.find(
sParams, "([^%s]+)%s*(.*)"))
You can see (assuming match) something like:
[5/11/2021 12:10:02 PM] #1|#11|s'1d6-1|'s'd6-1'
Which seems to imply the return values are: start, end, string being searched, matching part of the search (normally retrieved with sub())
Now, that is fine (and greatly convenient) and I should move on ;) but I just wanted to know where I SHOULD be looking to get right Lua documentation then because googling is steering me wrong ;) in at least this situation and maybe more I didn't know about.