title: How to efficiently remove double quotes from std::string if they exist
body: <p>This question risks being a duplicate e.g. <a href="https://stackoverflow.com/questions/5674374/remove-double-quotes-from-a-string-in-c">remove double quotes from a string in c++</a>
  but none of the asnwers that I saw addresses my question <br>
  I have a list of strings, some of which are double quoted and some aren't, Quotes are always at beginning and end<br></p>
  
  <pre><code>std::vector&lt;std::string&gt; words = boost::assign::list_of("words")( "\"some\"")( "of which")( "\"might\"")("be quoted");
  </code></pre>
  
  <p>I am looking for the most efficient way to remove the quotes. Here is my attempt<br></p>
  
  <pre><code>for(std::vector&lt;std::string&gt;::iterator pos = words.begin(); pos != words.end(); ++pos)
  {
    boost::algorithm::replace_first(*pos, "\"", "");
    boost::algorithm::replace_last(*pos, "\"", "");
    cout &lt;&lt; *pos &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Can I do better than this? I have potentially hundreds of thousands of string to process.They may come from a file or from a database. The std::vector in the example is just for illustration purposes. </p>