Lua string一些東西
一,函數
string.len(s)
string.find(s, sd, [index]) 返回i, j 表示 起始,終了位置索引。
string.sub
string.gsub
string.gfind
string.char
string.byte
string.format
二,字符類和模式修飾符
. 任意字符
%a 字母
%c 控制字符
%d 數字
%l 小寫字母
%p 標點字符
%s 空白符
%u 大寫字母
%w 字母和數字
%x 十六進制數字
%z 代表0的字符
模式修飾符有四個:
+ 匹配前一字符1次或多次
* 匹配前一字符0次或多次
- 匹配前一字符0次或多次
? 匹配前一字符0次或1次
posted on 2009-04-29 15:51 Brandon 閱讀(1170) 評論(0) 編輯 收藏 引用 所屬分類: 腳本語言