title: How to remove all chars except those in CharacterSet in Swift
body: <p>I am trying to trim a phone number and using the following code but it does not trim whitespace or the '-'. I need to erase all chars except those in the character set given</p>
  
  <pre><code> func trimmedNumber(s : String)-&gt;String
   {
      let characterSet = NSCharacterSet(charactersInString: "+*#0123456789")
     let trimmedString =  s.stringByTrimmingCharactersInSet(characterSet.invertedSet)
      return trimmedString
  }
  </code></pre>