给字符串添加逗号

如何在字符串内部添加逗号分隔文本

假设有以下字符串:

local s = "some text here"

我想将该字符串(无空格)转换为:

local t = "some,text,here"

任何帮助都将不胜感激..

点赞
用户624261
用户624261

你可以使用gsub()函数。

t=string.gsub(s," ",",")
2013-07-21 10:27:51