string扩展模块新增一个按字符数读+截取的方法

This commit is contained in:
MrZ626
2021-12-17 13:54:27 +08:00
parent 9bcb040019
commit 6d8478b029

View File

@@ -197,6 +197,9 @@ function STRING.readLine(str)
return str,""
end
end
function STRING.readChars(str,n)
return sub(str,1,n),sub(str,n+1)
end
function STRING.packBin(s)
return data.encode('string','base64',data.compress('string','zlib',s))