cb22-11" tabindex="-1"></a><span class="co">#&gt; [1] &quot;String with trailing and leading white space&quot;</span></span></code></pre></div>
<p>The stringr function <code>str_squish()</code> allows for extra
whitespace within a string to be trimmed (in contrast to
<code>str_trim()</code> which removes whitespace at the beginning and/or
end of string). In base R, one might take advantage of
<code>gsub()</code> to accomplish the same effect.</p>
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><