scripts.contact wrote:
On May 29, 8:11 pm, noagbodjivic...@gmail.com wrote:
You can write one:
String.prototype.rtrim = function() {
return this.replace(/\n\r/,"");}
String.prototype.rtrim = function() {
return this.replace(/[\n\r]/,"");}
No. The three most common EOLs are:
\n (Linefeed)
\r (Carriage return)
\r\n (Carriage return followed by linefeed)
But you also have:
NEL = Next Line (\u0085)
FF = Form Feed (\u000C)
LS = Line Separator (\u2028)
PS = Paragraph Separator (\u2029)
A fully backwards compatible, Unicode-compliant regexp would be:
/(\r\n|\r|\n|\u0085|\u000C|\u2028|\u2029)/g
--
Bart