How to remove the last \"\\n\" from a textarea?
$.trim() should do the trick!
It trims whitespace and newline characters from the beginning and ending of the specified string.