feat: add strgfind and tostringall WoW Lua utilities

strgfind = string.gmatch alias (deprecated WoW function used by
older addons that haven't migrated to string.gmatch).

tostringall(...) converts all arguments to strings and returns
them. Used by chat formatting and debug addons that need to safely
stringify mixed-type argument lists.
This commit is contained in:
Kelsi 2026-03-22 21:17:59 -07:00
parent f4d78e5820
commit 7b88b0c6ec

View file

@ -5964,6 +5964,14 @@ void LuaEngine::registerCoreAPI() {
"strrep = string.rep\n"
"strbyte = string.byte\n"
"strchar = string.char\n"
"strgfind = string.gmatch\n"
"function tostringall(...)\n"
" local n = select('#', ...)\n"
" if n == 0 then return end\n"
" local r = {}\n"
" for i = 1, n do r[i] = tostring(select(i, ...)) end\n"
" return unpack(r, 1, n)\n"
"end\n"
"strrev = string.reverse\n"
"gsub = string.gsub\n"
"gmatch = string.gmatch\n"