title: How to fill a section within c++ string?
body: <p>Having a string of whitespaces:</p>
  
  <pre><code>string *str = new string();
  str-&gt;resize(width,' ');
  </code></pre>
  
  <p>I'd  like to
  fill length chars at a position.</p>
  
  <p>In C it would look like</p>
  
  <pre><code>memset(&amp;str[pos],'#', length );
  </code></pre>
  
  <p>How can i achieve this with c++ string, I tried</p>
  
  <pre><code> string&amp; assign( const string&amp; str, size_type index, size_type len );
  </code></pre>
  
  <p>but this seems to truncat the original string.
  Is there an easy C++ way to do this?
  Thanks.</p>