uot;</span></span></code></pre></div>
<p><code>str_sub()</code> does what you would expect:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" tabindex="-1"></a><span class="co"># stringr</span></span>
<span id="cb12-2"><a href="#cb12-2" tabindex="-1"></a>x <span class="ot">&lt;-</span> <span class="st">&quot;ABCDEF&quot;</span></span>
<span id="cb12-3"><a href="#cb12-3" tabindex="-1"></a><span class="fu">str_sub</span>(x, <span cla