bgm模块新增瞬间开/关功能

字符串扩展模块不再直接修改全局的string,需要外部自己补充
This commit is contained in:
MrZ626
2021-12-15 11:28:25 +08:00
parent a3d2b7b7f3
commit 6ccdee2a53
5 changed files with 33 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ local find,sub,gsub,upper=string.find,string.sub,string.gsub,string.upper
local char,byte=string.char,string.byte
--"Replace dollars", replace all $n with ...
function string.repD(str,...)
function STRING.repD(str,...)
local l={...}
for i=#l,1,-1 do
str=gsub(str,'$'..i,l[i])
@@ -15,7 +15,7 @@ function string.repD(str,...)
end
--"Scan arg", scan if str has the arg (format of str is like "-json -q", arg is like "-q")
function string.sArg(str,switch)
function STRING.sArg(str,switch)
if find(str.." ",switch.." ")then
return true
end