//替换指定串
s = string.gsub("Lua is good", "good", "bad")
print(s) --> Lua is bad
//替换特殊字符
a = "我们使用$";
b = string.gsub(a, "%$", "RMB");
print(b) --> 我们使用RMB
//替换反斜杠
path = a/b/c\d/e.txt
path= string.gsub(path, "\\", "/")
print(path) --> a/b/c/d/e.txt
其他替换参考: