首页 > 技术文章 > Lua String库的使用(随记)

zero17 2022-04-17 20:07 原文

function yzm_func(n)
if type(n) ~= 'number' and n < 1 then
return 0
end
local yzm_str = ""
for i=1, n do
local random_str = string.char(math.random(string.byte('0'),string.byte('Z')))
yzm_str = yzm_str..random_str
end
return yzm_str
end

推荐阅读