In Haskell, how do you trim whitespace from the beginning and end of a string?
How do you trim whitespace from the start and end of a string? trim " abc " => "abc" Edit: Ok, let me be a little clearer. I did not understand that string literals were treated so differently from Strings. I would like to do this: import qualified Data.Text as T let s :: String = " abc " in T.strip s Is this possible in Haskell? I am using -XOverloadedStrings but that appears only to work for literals. If you have serious text processing needs then use the text package from hackage: > :set -XOverloadedStrings > import Data.Text > strip " abc " "abc" If you're too stubborn to use text and don