Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Multisplit/XPL0/multisplit.xpl0
Normal file
22
Task/Multisplit/XPL0/multisplit.xpl0
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
include xpllib; \for StrLen, StrNCmp, and Print
|
||||
|
||||
proc MultiSplit(Str, Seps, N);
|
||||
char Str; int Seps, N;
|
||||
int S, Ch, SepLen;
|
||||
[while Str(0) # 0 do
|
||||
[for S:= 0 to N-1 do
|
||||
[SepLen:= StrLen(Seps(S));
|
||||
if StrNCmp(Str, Seps(S), SepLen) = 0 then
|
||||
[Print(" (%s) ", Seps(S));
|
||||
Str:= Str + SepLen;
|
||||
S:= 100;
|
||||
];
|
||||
];
|
||||
if S < 100 then
|
||||
[Ch:= Str(0); Str:= Str+1;
|
||||
if Ch # 0 then ChOut(0, Ch);
|
||||
];
|
||||
];
|
||||
];
|
||||
|
||||
MultiSplit("a!===b=!=c", ["==", "!=", "="], 3)
|
||||
Loading…
Add table
Add a link
Reference in a new issue