Tokenize a string: Difference between revisions

m
Line 164:
joinWith :: [a] -> <nowiki>[[a]]</nowiki> -> [a]
joinWith _d []xs = concat $ List.intersperse =d []xs
joinWith _ [x] = x
joinWith d (x:xs) = x ++ d ++ joinWith d xs
 
putStrLn $ joinWith "." $ splitBy (== ',') $ "Hello,How,Are,You,Today"
Anonymous user