工作中有遇到崩溃,最后发现是崩在lua的print中。
怀疑是长度超限,于是就写测试代码来验证。
local testString = "7"
while(1) do
if #testString > 16300 then
testString = testString.."x"
else
testString = testString.."66666666666666666666666666666666666666666666666666666666666666666666666666"
end
print(#testString.."cnt")
print(testString.."")
end
结论是:16369cnt崩溃了,最大长度限制是16368。
最后
以上就是故意过客最近收集整理的关于lua的print长度限制的全部内容,更多相关lua内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复