How do you trim whitespace from the start and end of a string?
trim \" abc \"
=>
\"abc\"
Edit:
Ok, let me be a little cleare
Along the lines of what other people have suggested, you can avoid having to reverse your string by using:
import Data.Char (isSpace)
dropFromTailWhile _ [] = []
dropFromTailWhile p item
| p (last items) = dropFromTailWhile p $ init items
| otherwise = items
trim :: String -> String
trim = dropFromTailWhile isSpace . dropWhile isSpace