lea*_*eak 1 string lua escaping
你好,我想知道我是否可以在多行字符串中转义 [[ 和 ]]
例子:
s = [[ [[ test ]] ]]
Run Code Online (Sandbox Code Playgroud)
然后如果我这样做
print(test)
Run Code Online (Sandbox Code Playgroud)
我希望输出是, [[ test ]]
有没有办法做到这一点?
Lua 多行字符串不仅仅使用[[and ]]; 您也可以=在两者之间放置尽可能多的[和](但必须是相同的数字):
local str = [=====[
]] This does nothing
]=] not enough =
]==========] too many =
]=====] -- This closes the string
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
177 次 |
| 最近记录: |