19/05/14 23:52:44.04 AtHJrRxM.net
>>882 Squeak Smalltalk
| fn |
fn := [:str |
((str lines collectWithIndex: [:line :lIdx |
(line reject: #isSeparator) asArray
collect: [:chr | {chr. (line indexOf: chr) - 1. lIdx - 1}]]
) concatenation select: #notEmpty) asStringWithCr
].
fn value: 'a b c
d'
"=>
'#($a 0 0)
#($b 2 0)
#($c 4 0)
#($d 0 2)' "