RosettaCodeData/Task/Range-extraction/J/range-extraction-1.j
2015-11-18 06:14:39 +00:00

3 lines
132 B
Text

fmt=: [: ;@(8!:0) [`]`({. ; (',-' {~ 2 < #) ; {:)@.(2 <. #)
group=: <@fmt;.1~ 1 ~: 0 , 2 -~/\ ]
extractRange=: ',' joinstring group