Multisplit: Difference between revisions
J: review, clarification, and added missing variable from example
m (Mark solutions as needing review) |
(J: review, clarification, and added missing variable from example) |
||
Line 8:
=={{header|J}}==
<lang j>multisplit=:4 :0
'sep begin'=.|:t=. y /:~&.:(|."1)@;@(i.@#@[ ,.L:0"0 I.@E.L:0) x
Line 26 ⟶ 25:
First find all potentially relevant separator instances, and sort them in increasing order, by starting location and separator index. <code>sep</code> is separator index, and <code>begin</code> is starting location. <code>end</code> is ending location.
Then, loop through the possibilities, skipping over those separators which
Example use:
<lang j> S
S multisplit '==';'!=';'='
┌───┬───┬───┬───┬─┐
│a │ │b │ │c│
|