Lua 常规替换字符串如何替换
s = string.gsub("Lua is good", "good", "bad")
print(s) --> Lua is bad
Lua 常规替换特殊字符
a = "我们使用$";
b = string.gsub(a, "%$", "RMB");
print(b) --> 我们使用RMB
其他替换相关参考
http://blog.csdn.net/weiyuefei/article/details/52044235
2022-12-29 12:10:47
s = string.gsub("Lua is good", "good", "bad")
print(s) --> Lua is bad
a = "我们使用$";
b = string.gsub(a, "%$", "RMB");
print(b) --> 我们使用RMB
http://blog.csdn.net/weiyuefei/article/details/52044235