How do I remove the last character of a string if it is a newline?

"abc\n"  -->  "abc"

2
27

Leave a Reply

Your email address will not be published. Required fields are marked *