mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 01:00:13 +00:00
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:
parent
f4d78e5820
commit
7b88b0c6ec
1 changed files with 8 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue