Lua字符串转int [英] Lua string to int
本文介绍了Lua字符串转int的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Lua中将字符串转换为整数?
How can I convert a string to an integer in Lua?
我有一个这样的字符串:
I have a string like this:
a = "10"
我想把它转换成数字 10.
I would like it to be converted to 10, the number.
推荐答案
使用 tonumber
函数.如a = tonumber("10")
.
这篇关于Lua字符串转int的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文