Created
August 28, 2015 07:15
-
-
Save warreee/ab1dcaefb0832e3e8d1c to your computer and use it in GitHub Desktop.
Separate a string based on '/' so you can past it easily in e.g. Google Sheets.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad | |
sep [] = [] | |
sep xs = word : sep ((drop ((length word) + 1) xs)) | |
where word = takeWhile (/= '/') xs | |
main = do | |
xs <- getLine | |
putStrLn "" | |
mapM_ (\x -> putStrLn x) (sep xs) | |
putStrLn "" | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment