熱更新03_標(biāo)準(zhǔn)庫函數(shù)Day1128

Lua內(nèi)置提供了一些常用的函數(shù)幫助我們開發(fā)

1,數(shù)學(xué)處理的math相關(guān)函數(shù)

2,字符串處理的string相關(guān)函數(shù)

3,表處理的table相關(guān)函數(shù)

4,文件操作的io相關(guān)函數(shù)


數(shù)學(xué)運(yùn)算函數(shù)math

math.abs

math.cos

math.max

math.maxinteger

math.min

math.random

math.sin

math.sqrt

math.tan


字符串處理相關(guān)函數(shù)

string.byte

string.char

string.find

sting.format

string.lower

string.sub

string.upper

.. 字符串相加

tostring()? 把一個數(shù)字轉(zhuǎn)化成字符串

tonumber() 把一個字符串轉(zhuǎn)化成數(shù)字



表相關(guān)的函數(shù)

1.table.concat

把表中所有數(shù)據(jù)連成一個字符串

2,table.insert

向指定位置插入一個數(shù)據(jù)

3,table.move

移動數(shù)據(jù)

4,table.pack

包裝成一個表

5,table.remove

移除指定位置的數(shù)據(jù)

6,table.sort

排序

7,table.unpack

返回一個數(shù)組,指定范圍的數(shù)組

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容