7 Apr
2003
7 Apr
'03
3:30 a.m.
Hello, Please help me with this: I'm absolute newbie in Haskell, I hope I'm posting to right forum. (1) For "abcdefgh" -> ["ab","cd","ef"] I figured this out: foo (x:y:z) = ( (x:y) :(foo z)) Now how generalize this to club 'n' chars instead of two ? 3 -> "abcdefgh" -> ["abc","def","gh"] i.e. n -> [Char] -> [ [Char] ] -- all except last element have length == n (2) My original problem is of splitting by markers. "a<b>cd<efg>hi" -> [ "a" , "b", "cd", "efg", "hi" ] I'm at total loss on how to do it. Any pointer will be appreciated. --TIA --Vardhan