Swap The Characters by oerjan(less clever, thus shorter. Bah!)

m@main=getLine>>=putStrLn.foldl1(#).words>>m
w#l=[c!filter(/=c)l|c<-w]
_![e]=e
c!_=c

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page