title: Delete characters form a string in C++
body: <p>I'm beginning in C++ and I have a simple task. As title said, I want to delete first and last character from a string for x times (where x is the lenght of the string). For example, if the string is <strong>"example"</strong>, the result will be:
      <br>
  <code>
  example <br>
  xampl<br>
  amp<br>
  m<br>
  amp<br>
  xampl<br>
  example<br>
  </code></p>
  
  <p>So far, I'm thinking like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  string sir = "Example";
  int len, i;
  len = sir.length();
  
  for(i=1; i&lt;=len; i++)
  {
      sir.erase(sir.begin(), sir.end());
      cout&lt;&lt;sir;    
  }
  </code></pre>
  
  <p>Or something like that... Can someone help me ?</p>