Lua中..和#运算符的用法

Lua中..和#运算符的用法


样例

试试以下的样例就明确了在Lua编程语言提供的其它运算符:

a = "Hello "
b = "World"
print("Concatenation of string a with b is ", a..b )
print("Length of b is ",#b )
print("Length of b is ",#"Test" )


当建立并运行上面的程序它会产生下面结果

Concatenation of string a with b is  Hello World
Length of b is  5
Length of b is  4


posted @ 2017-07-13 18:29  brucemengbm  阅读(685)  评论(0编辑  收藏  举报