Skip to content

Instantly share code, notes, and snippets.

@warreee
Created August 28, 2015 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save warreee/ab1dcaefb0832e3e8d1c to your computer and use it in GitHub Desktop.
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.
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