Transpose a page of text
J (31 40) 

f=:3 :';(,&amp;LF@dlb&amp;.|.)&amp;.&gt;&lt;"1|:&gt;LF cut y'


This is a function that takes a string, and returns a string (i.e. a character vector with linefeeds inserted in the right places, and not a matrix.)

Edit: no trailing whitespace on any line.

Test:

   f=:3 :';(,&amp;LF@dlb&amp;.|.)&amp;.&gt;&lt;"1|:&gt;LF cut y'

   string=:stdin''
I am a text.
Transpose me.
Can you do it?
^D

   $string
42
   $f string
53
   f string
ITC
 ra
aan
mn
 sy
apo
 ou
ts
eed
x o
tm
.ei
 .t
  ?