[removed] how to use a regular expression to remove blank lines from a string?

后端 未结 4 1546
走了就别回头了
走了就别回头了 2020-12-01 03:48

I need to use JavaScript to remove blank lines in a HTML text box. The blank lines can be at anywhere in the textarea element. A blank line can be just a return

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 03:54

    I believe this will work

    searchText.replace(/(^[ \t]*\n)/gm, "")
    

提交回复
热议问题