title: Remove trailing letters at the end of string
body: <p>I have some strings like below:</p>
  
  <pre><code>ffffffffcfdeee^dddcdeffffffffdddcecffffc^cbcb^cb`cdaba`eeeeeefeba[NNZZcccYccaccBBBBBBBBBBBBBBBBBBBBBB
  
  eedeedffcc^bb^bccccbadddba^cc^e`eeedddda`deca_^^\```a```^b^`I^aa^bb^`_b\a^b```Y_\`b^`aba`cM[SS\ZY^BBB
  </code></pre>
  
  <p>Each string may (or may not) end with a stretch of trailing <code>B</code> of varied length.
  I'm just wondering if we can simply use Bash code to remove the <code>B</code> stretch?</p>