http://www.runoob.com/manual/lua53doc/manual.html#6.2 lua函数库
三元运算 return true and 1 or 2
match
len("abcd") == 4
lower(s)小写
upper(s)大写
rep("*",3)--*** 重复
string
sub("[in brackets]",2,-2) == in brackets 根据下标截取
char(97,100,101) == abc 阿斯克吗值转换
byte("abcdef",3,5) 阿斯克吗值转换
string 查找下标位置
s = "hello world"
find(s,"hello") --> 1 5
find(s,"l") --> 3 返回第一次出现的位置
find(s,"l",4) --4 从第4个开始查找,返回位置
match 字符串匹配类型
date ="tody is 17/7/1990"
string.match(date,"%d+/%d+/%d+") -->17/7/1990
gusb 字符串替换
string.gusb("lua is cute","cute","greate") --> lua is greate
gusb("alllll","l","x") -- > axxxxx
gusb("alllll","l","x",2) -- > axxlll