-- | String utility functions not available in some library.
--
module String ( trim )
where


-- | Strip leading/trailing whitespace, and collapse multiple
--   consecutive spaces into one.
--
--   ==== __Examples__
--
--   >>> trim "\thello"
--   "hello"
--
--   >>> trim "\n\t\nhello,    world! "
--   "hello, world!"
--
trim :: String -> String
trim = unwords . words
