Lua内置提供了一些常用的函数帮助我们开发
1,数学处理的math相关函数
2,字符串处理的string相关函数
3,表处理的table相关函数
4,文件操作的io相关函数
数学运算函数math
math.abs
math.cos
math.max
math.maxinteger
math.min
math.random
math.sin
math.sqrt
math.tan
字符串处理相关函数
string.byte
string.char
string.find
sting.format
string.lower
string.sub
string.upper
.. 字符串相加
tostring() 把一个数字转化成字符串
tonumber() 把一个字符串转化成数字
表相关的函数
1.table.concat
把表中所有数据连成一个字符串
2,table.insert
向指定位置插入一个数据
3,table.move
移动数据
4,table.pack
包装成一个表
5,table.remove
移除指定位置的数据
6,table.sort
排序
7,table.unpack
返回一个数组,指定范围的数组
网友评论