Data.String.HT

utility-ht-0.0.12: Various small helper functions for Lists, Maybes, Tuples, Functions

Safe Haskell | Safe
Language | Haskell98

Data.String.HT

Synopsis

- trim :: String -> String

# Documentation

trim :: String -> String #

Remove leading and trailing spaces.

We use spine strict `dropWhile` instead of the element strict version. This is more efficient for finite `String`s because `isSpace` is expensive. The downside is that `trim` does not work for infinite `String`s.