Lua 编程/插值
外观
在字符串中没有默认支持自动插值变量名作为占位符。但是,可以使用 [string.gsub] 函数来模拟插值。
mystring = string.gsub("Mary had a X lamb.", "X", "little") print mystring
字面字符转义序列的插值发生在字符串中。
print "Mary had a \n lamb" -- The \n is interpreted as an escape sequence for a newline
粗体文本