简体   繁体   中英

how to remove unicode new line from javascript string

I was replacing new line with the following javascript code:

str.replace(/(\r\n|\n|\r)/gm," ")

However, came across some Unicode new line Unicode Character 'NEXT LINE (NEL)' (U+0085).

How to remove new lines from a string safely ie all these weird new lines will be removed as well?

Is it an established API for javascript?

I was replacing new line with the following javascript code:

str.replace(/(\r\n|\n|\r)/gm," ")

However, came across some Unicode new line Unicode Character 'NEXT LINE (NEL)' (U+0085).

How to remove new lines from a string safely ie all these weird new lines will be removed as well?

Is it an established API for javascript?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM