Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我该怎么做?
我懂了:
名称 = "^aH^ai" string.gsub(名称,“^a”,“”)
它应该返回“Hi”,但它将插入符号作为模式字符
有什么办法可以解决这个问题?(必须在 gsub 中完成)
尝试:
name = "^aH^ai" name = name:gsub("%^a", "")
另见: http: //lua-users.org/wiki/StringLibraryTutorial