Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Multisplit/MiniScript/multisplit.mini
Normal file
19
Task/Multisplit/MiniScript/multisplit.mini
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
parseSep = function(s, pats)
|
||||
result = []
|
||||
startPos = 0
|
||||
pos = 0
|
||||
while pos < s.len
|
||||
for pat in pats
|
||||
if s[pos : pos+pat.len] != pat then continue
|
||||
result.push s[startPos : pos]
|
||||
result.push "{" + pat + "}"
|
||||
startPos = pos + pat.len
|
||||
pos = startPos - 1
|
||||
break
|
||||
end for
|
||||
pos = pos + 1
|
||||
end while
|
||||
return result
|
||||
end function
|
||||
|
||||
print parseSep("a!===b=!=c", ["==", "!=", "="])
|
||||
Loading…
Add table
Add a link
Reference in a new issue