( " apples, pears # and bananas oranges, mangos ; and a durian" : ?text & :?newText & ( non-blank = %@:~(" "|\t|\r|\n) ) & ( cleanUp = . @(!arg:?arg ("#"|";") ?) & @(rev$!arg:? (!non-blank ?:?arg)) & @(rev$!arg:? (!non-blank ?:?arg)) & !arg {You could write & "[" !arg "]" to prove that the blanks are stripped.} ) & whl ' ( @(!text:?line (\r|\n) ?text) & !newText \n cleanUp$!line:?newText ) & !newText \n cleanUp$!text:?newText & out$(str$!newText) );