[英]Remove line breaks if there are no characters on that line
I'm trying to remove linebreaks if there are no characters next to it. 我正在尝试删除换行符,如果旁边没有字符。
I'd like to keep Line1, Line2, Line3 untouched but the break after Line3 and before Line1 removed. 我想保持Line1,Line2,Line3不变,但是在Line3之后和Line1删除之前的中断。
I tried: 我试过了:
Element.value = Element.value.replace(/\n?![A-z]/g, "");
I'm not too good with regex. 我对正则表达式不太满意。
Thanks. 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.