splitStr函数定义放入toolFunc文件并全局
This commit is contained in:
@@ -4,16 +4,6 @@ local sub,find=string.sub,string.find
|
|||||||
local toN,toS=tonumber,tostring
|
local toN,toS=tonumber,tostring
|
||||||
local concat=table.concat
|
local concat=table.concat
|
||||||
|
|
||||||
local function splitS(s,sep)
|
|
||||||
local L={}
|
|
||||||
local p1,p2=1--start,target
|
|
||||||
while p1<=#s do
|
|
||||||
p2=find(s,sep,p1)or #s+1
|
|
||||||
L[#L+1]=sub(s,p1,p2-1)
|
|
||||||
p1=p2+#sep
|
|
||||||
end
|
|
||||||
return L
|
|
||||||
end
|
|
||||||
local tabs={
|
local tabs={
|
||||||
[0]="",
|
[0]="",
|
||||||
"\t",
|
"\t",
|
||||||
|
|||||||
@@ -39,7 +39,16 @@ do--setFont
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function splitStr(s,sep)
|
||||||
|
local L={}
|
||||||
|
local p1,p2=1--start,target
|
||||||
|
while p1<=#s do
|
||||||
|
p2=find(s,sep,p1)or #s+1
|
||||||
|
L[#L+1]=sub(s,p1,p2-1)
|
||||||
|
p1=p2+#sep
|
||||||
|
end
|
||||||
|
return L
|
||||||
|
end
|
||||||
function toTime(s)
|
function toTime(s)
|
||||||
if s<60 then
|
if s<60 then
|
||||||
return format("%.3fs",s)
|
return format("%.3fs",s)
|
||||||
|
|||||||
Reference in New Issue
Block a user