Concatenation of strings in Lua

后端 未结 4 798
庸人自扰
庸人自扰 2021-01-31 01:10

In many languages you can concatenate strings on variable assignment. I have a scenario, using the Lua programming language, where I need to append the output of a command to a

4条回答
  •  南旧
    南旧 (楼主)
    2021-01-31 01:51

    Concatenation:

    The string concatenation operator in Lua is denoted by two dots ('..'). If both operands are strings or numbers, then they are converted to strings according to the rules mentioned in §2.2.1. Otherwise, the "concat" metamethod is called (see §2.8).

    from: http://www.lua.org/manual/5.1/manual.html#2.5.4

提交回复
热议问题