cut string by test

main=do x<-readLn;interact$unwords.(x#).words
i#((x:y):z)=case(i-1)#(y:z)of(y:z)->(x:y):z
i#([]:z)|i<0=[[]]|0<1=case(i#z)of z->[]:z

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

download

return to the top page