title: Trimming a vector of strings
body: <p>I have an <code>std::vector</code> of <code>std::strings</code> containing data similar to this:</p>
  <pre><code>[0] = &quot;&quot;
  [1] = &quot;Abc&quot;
  [2] = &quot;Def&quot;
  [3] = &quot;&quot;
  [4] = &quot;Ghi&quot;
  [5] = &quot;&quot;
  [6] = &quot;&quot;
  </code></pre>
  <p>How can I get a vector containing the 4 strings from 1 to 4? (i.e. I want to trim all blank strings from the start and end of the vector):</p>
  <pre><code>[0] = &quot;Abc&quot;
  [1] = &quot;Def&quot;
  [2] = &quot;&quot;
  [3] = &quot;Ghi&quot;
  </code></pre>
  <p>Currently, I am using a forward iterator to make my way up to <code>&quot;Abc&quot;</code> and a reverse iterator to make my way back to <code>&quot;Ghi&quot;</code>, and then constructing a new vector using those iterators. This method works, but I want to know if there is an easier way to trim these elements.</p>
  <p>P.S. I'm a C++ noob.</p>
  <h3>Edit</h3>
  <p>Also, I should mention that the vector may be composed entirely of blank strings, in which case a 0-sized vector would be the desired result.</p>