By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,568 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,568 IT Pros & Developers. It's quick & easy.

How to replace line break characters?

P: n/a
Hello,

What am I doing wrong in my regular expression? I'm trying to replace
line break characters by

responseText =
responseText.replace(/(\r|\n)/, "");

However my response still contains characters with ASCII values of 10.
How can I rewrite the above?

Thanks, - Dave

Aug 30 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Did you try something like this:
responseText =responseText.replace(/[\r\n]+/g, "");
This is explained token:
[\r\n]+
Match a single character present in the list below «[\r\n]+»
Between one and unlimited times, as many times as possible, giving
back as needed (greedy) «+»
A carriage return character «\r»
A line feed character «\n»

Best Regards
la***********@zipmail.com написа:
Hello,

What am I doing wrong in my regular expression? I'm trying to replace
line break characters by

responseText =
responseText.replace(/(\r|\n)/, "");

However my response still contains characters with ASCII values of 10.
How can I rewrite the above?

Thanks, - Dave
Aug 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.