()</code>: Replace matched patterns in a
string</h2>
<p>To replace certain patterns within a string, stringr provides the
functions <code>str_replace()</code> and <code>str_replace_all()</code>.
The base R equivalents are <code>sub()</code> and <code>gsub()</code>.
Note the difference in default input order again.</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1" tabindex="-1"></a>fruits <span class="ot">&lt;-</span> <span class="f