malongshuai / malongshuai.github.io

2 stars 0 forks source link

Lua字符串和Lua正则 | 骏马金龙 #244

Open malongshuai opened 2 years ago

malongshuai commented 2 years ago

https://www.junmajinlong.com/lua/lua_str_regex/

回到: Lua系列文章 字符串在Lua中,字符串是不可变的,所以相同内容的字符串在lua进程的内存中只有一份。 1a,b,c = "hello","hello","hello" -- (a,b,c) --> "hello" 因为字符串不可变,所以任何带有修改性质的字符串操作,都会创建一个新的字符串。 字符串字面量字符串可使用单引号、双引号包围,它们在效果上等价。 12"