
Format plain text using JScript?
Hi
Assuming str is holding the data
var re = /\n/g;
var fstr = str.replace(re,"<br>");
--
Best Regards
Vidar Petursson Microsoft MVP
http://www.icysoft.com
No matter where you go there you are
-
Quote:
> Is there anybody who has an idea how to remove <cr> in a txt-string.
> I read a multiline text-file from the filesystem and assign this to a
> variable. However I want to remove blank lines, linefeeds and carriage
> returns to compress the text.
> I've tried search and replace, replacing with re=\n; s.replace(re, " ");
> In fact i've tried with both \n and \r, still the string print out with no
> difference at all.
> Any ideas?
> JE Holen