title: How can I remove or replace all punctuation characters from a String?
body: <p>I have a string composed of words, some of which contain punctuation, which I would like to remove, but I have been unable to figure out how to do this.</p>
  
  <p>For example if I have something like</p>
  
  <pre><code>var words = "Hello, this : is .. a  string?"
  </code></pre>
  
  <p>I would like to  be able to create an array with </p>
  
  <pre><code>"[Hello, this, is, a, string]"
  </code></pre>
  
  <p>My original thought was to use something like <code>words.stringByTrimmingCharactersInSet()</code> to remove any characters I didn't want but that would only take characters off the ends.</p>
  
  <p>I thought maybe I could iterate through the string with something in the vein of</p>
  
  <pre><code>for letter in words {
      if NSCharacterSet.punctuationCharacterSet.characterIsMember(letter){
          //remove that character from the string
      }
  }
  </code></pre>
  
  <p>but I'm unsure how to remove the character from the string. I'm sure there are some problems with the way that if statement is set up, as well, but it shows my thought process. </p>