更多操作
创建页面,内容为“local p = {} function p.replace(str, target, result) local res = str:gsub(target, result) return res end function p.split(str, separator) local fields = {} local temp = str:gsub(", ", ",") temp:gsub("[^"..separator.."]+", function(c) fields[#fields + 1] = c end) return fields end return p” |
小 AkiraZea移动页面模块:String至模块:StringUtil,不留重定向 |
(没有差异)
|
2025年3月31日 (一) 15:40的版本
此模块的文档可以在模块:StringUtil/doc创建
local p = {}
function p.replace(str, target, result)
local res = str:gsub(target, result)
return res
end
function p.split(str, separator)
local fields = {}
local temp = str:gsub(", ", ",")
temp:gsub("[^"..separator.."]+", function(c) fields[#fields + 1] = c end)
return fields
end
return p