RosettaCodeData/Task/Multisplit/EasyLang/multisplit.easy

18 lines
406 B
Text
Raw Permalink Normal View History

2025-06-11 20:16:52 -04:00
proc multisplit str$ sep$[] .
2024-07-13 15:19:22 -07:00
repeat
min = 1 / 0
for sep$ in sep$[]
pos = strpos str$ sep$
if pos > 0 and pos < min
min = pos
msep$ = sep$
.
.
until min = 1 / 0
write substr str$ 1 (min - 1) & "{" & msep$ & "}"
str$ = substr str$ (min + len msep$) 9999
.
print str$
.
multisplit "a!===b=!=c" [ "==" "!=" "=" ]