title: remove char from stringstream and append some data
body: <p>In my code there is a loop that adds sth like that "number," to stringstream. When it ends, I need to extract ',' add '}' and add '{' if the loop is to repeated.</p>
  
  <p>I thought i can use ignore() to remove ',' but it didn't work. Do you know how I can do what I describe?</p>
  
  <p>example:</p>
  
  <pre><code>douCoh &lt;&lt; '{';
  for(unsigned int i=0;i&lt;dataSize;i++)
    if(v[i].test) douCoh &lt;&lt; i+1 &lt;&lt; ',';
  douCoh.get(); douCoh &lt;&lt; '}';
  </code></pre>