 <p>you can use <a href="http://www.cplusplus.com/reference/algorithm/replace/" rel="nofollow"><code>std::replace</code></a> </p> <pre><code>std::replace (test.begin(), test.end(), "bird", "book"); </code></pre>