Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 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