我是靠谱客的博主 拼搏汉堡,这篇文章主要介绍lua string.fromat,现在分享给大家,希望可以做个参考。

lua里format打印boolean类型,如果使用了%s或%d会报如下错误:bad argument #2 to ‘format’ (string expected, got boolean)

解决方法:查了如下,把boolean转换成string再打印。

https://stackoverflow.com/questions/46056455/bad-argument-3-to-format-string-expected-got-boolean
You need to manually evaluate boolean type to string.
Try this,
string.format(“You%s need a %s”, negation, tostring(clothwear or summerwear or innerwear or southerwear or outerwear))

最后

以上就是拼搏汉堡最近收集整理的关于lua string.fromat的全部内容,更多相关lua内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(118)

评论列表共有 0 条评论

立即
投稿
返回
顶部