From dba1043ed85afaf1bd05d023f66ec1629dfccf4f Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 18 Sep 2020 19:30:19 +0800 Subject: [PATCH] =?UTF-8?q?splitStr=E5=87=BD=E6=95=B0=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=94=BE=E5=85=A5toolFunc=E6=96=87=E4=BB=B6=E5=B9=B6=E5=85=A8?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/file.lua | 10 ---------- Zframework/toolfunc.lua | 11 ++++++++++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Zframework/file.lua b/Zframework/file.lua index edc4d7e5..71dacc8d 100644 --- a/Zframework/file.lua +++ b/Zframework/file.lua @@ -4,16 +4,6 @@ local sub,find=string.sub,string.find local toN,toS=tonumber,tostring 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={ [0]="", "\t", diff --git a/Zframework/toolfunc.lua b/Zframework/toolfunc.lua index bd2b7b73..9aa6ba6c 100644 --- a/Zframework/toolfunc.lua +++ b/Zframework/toolfunc.lua @@ -39,7 +39,16 @@ do--setFont 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) if s<60 then return format("%.3fs",s)