title: In Haskell, how do you trim whitespace from the beginning and end of a string?
body: <p>How do you trim whitespace from the start and end of a string?</p>
  
  <pre><code>trim "  abc " 
  
  =&gt;
  
  "abc"
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Ok, let me be a little clearer. I did not understand that string literals were treated so differently from Strings.</p>
  
  <p>I would like to do this:</p>
  
  <pre><code>import qualified Data.Text as T
  let s :: String = "  abc  "
  in T.strip s
  </code></pre>
  
  <p>Is this possible in Haskell? I am using -XOverloadedStrings but that appears only to work for literals.</p>