Remove trailing letters at the end of string
Posted
by
wang
on Stack Overflow
See other posts from Stack Overflow
or by wang
Published on 2011-11-27T21:55:13Z
Indexed on
2011/11/28
1:50 UTC
Read the original article
Hit count: 188
I have some strings like below:
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
Each string MAY (or may not) end with a stretch of trailing "B" of varied length. I'm just wondering if we can simply use bash code to remove the "B" stretch?
thx
© Stack Overflow or respective owner