title: How to remove special characters from string in Swift 2?
body: <p>The answer in
  <a href="https://stackoverflow.com/questions/28819779/how-to-strip-special-characters-out-of-string">How to strip special characters out of string?</a> 
  is not working.</p>
  
  <p>Here is what I got and it gives me an error  </p>
  
  <pre><code>func removeSpecialCharsFromString(str: String) -&gt; String {
      let chars: Set&lt;String&gt; = Set(arrayLiteral: "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLKMNOPQRSTUVWXYZ1234567890+-*=(),.:!_")
  
      return String(str.characters.filter { chars.contains($0) }) //error here at $0
  }
  </code></pre>
  
  <p>The error at <code>$0</code> says</p>
  
  <blockquote>
    <p>_Element (aka Character) cannot be converted to expected argument type 'String'.</p>
  </blockquote>