title: Easy way to shift specific characters in a string in C++?
body: <p>If I have the string <code>.....ZZ..ZZ.....</code> or <code>.Z.1.Z.23Z.4.Z55</code>,</p>
  
  <p>Is there an easy way of shifting all <code>Z</code>characters in the string one space right of the current position?</p>
  
  <p>Some additional test strings are:</p>
  
  <ul>
  <li><code>.Z</code></li>
  <li><code>Z.</code></li>
  <li><code>ZZ.</code></li>
  <li><code>.ZZ</code></li>
  <li><code>Z</code></li>
  <li><code>ZZ</code></li>
  <li><code>ZZZ</code></li>
  </ul>
  
  <p>I think a few of the higher voted answers to this question (including the currently accepted one) do not work on these tests.</p>