I need to remove the last instance of
>
from:
<b>
<a href="link">Home</a> >
<a href="link">Category</a> >
<a href="link">Sub-category</a> >
<a href="link">Sub-sub-category</a> >
</b>
I assume regex will need to be employed, but I haven't found any good ways to do it. I'm removing the last instance of the link with
(a:last).remove();
but, after a couple iterations, I get multiple > > > in a row with no links between
Could you wrap
<a href="link">...</a> >
in a span like so:<span><a href="link">...</a> ></span>
and then do(span:last).remove();
?It would lead to a cleaner solution with little extra markup.