Remove the last “\n” from a textarea

后端 未结 5 718
暖寄归人
暖寄归人 2021-02-06 21:30

How to remove the last \"\\n\" from a textarea?

5条回答
  •  鱼传尺愫
    2021-02-06 21:56

    $.trim() should do the trick!

    It trims whitespace and newline characters from the beginning and ending of the specified string.

提交回复
热议问题