in reply to Re: Removing multiple trailing comment lines from a string
in thread Removing multiple trailing comment lines from a string

I don't know how that translates to your real-world code. The solution I've provided below is substantially different from your code.
It's early days yet and requirements are a bit unclear right now. I was after ideas for general approaches and you've provided some interesting and useful code. Thanks.

  • Comment on Re^2: Removing multiple trailing comment lines from a string