整理代码,新增string扩展模块,把一些小模块合并进string和table扩展模块中

This commit is contained in:
MrZ626
2021-04-22 11:13:37 +08:00
parent 7b0717c392
commit 402f777a90
91 changed files with 258 additions and 191 deletions

View File

@@ -1,14 +0,0 @@
local rshift=bit.rshift
local b16={[0]="0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}
return function(str)
local out=""
for i=1,#str do
if str:sub(i,i):match("[a-zA-Z0-9]")then
out=out..str:sub(i,i)
else
local b=str:byte(i)
out=out.."%"..b16[rshift(b,4)]..b16[b%16]
end
end
return out
end