title: Delete certain characters from wstring
body: <p>My question is similar to <a href="https://stackoverflow.com/questions/5891610/how-to-remove-characters-from-a-string">this</a>, except that I'm dealing with <code>wstring</code> rather than <code>string</code>. I switched the types to <code>wstring</code> and <code>wchar_t</code> and compiled it but I'm getting an error. This is the code:</p>
  
  <pre><code>int delete_punc(std::wstring&amp; str)
  {
      wchar_t* chars = L".,!?";
      for (int i = 0; i &lt; sizeof(chars); i++)
          str.erase(std::remove(str.begin(), str.end(), chars[i]), str.end());
  
      return 0;
  }
  </code></pre>
  
  <p>This is the error that I get:</p>
  
  <pre><code>error: cannot convert ‘std::basic_string&lt;wchar_t&gt;::iterator
  {aka __gnu_cxx::__normal_iterator&lt;wchar_t*, std::basic_string&lt;wchar_t&gt; &gt;}’
  to ‘const char*’ for argument ‘1’ to ‘int remove(const char*)
  </code></pre>
  
  <p><strong>Edit:</strong>
  I also tried other brute force variants. Both returned the same error.</p>
  
  <pre><code>int delete_punc(std::wstring&amp; str)
  {
      //str.erase(std::remove(str.begin(), str.end(), L"."), str.end());
      //str.erase(std::remove(str.begin(), str.end(), "."), str.end());
      return 0;
  }
  </code></pre>