replace function

  • Thread starter Øyvind Isaksen
  • Start date
Ø

Øyvind Isaksen

Hi!

I use this function to show the text with linefeeds on my webpages:

-----------------------------------
replace(myText,Chr(13),"<br>")
----------------------------------

This works perfect if the variable "myText" just contains pure text.
But, if the variable contains a html table with break after the <table> tag,
<tr> tag and <td> tag, the table will not come in the top of the page as I
wanted.

My question:
Is there any smart way to "turn off" the replace-function just around the
<table> content in the myText-variable?
 
E

Evertjan.

Øyvind Isaksen wrote on 01 jan 2006 in
microsoft.public.inetserver.asp.general:
Hi!

I use this function to show the text with linefeeds on my webpages:

-----------------------------------
replace(myText,Chr(13),"<br>")
----------------------------------

This works perfect if the variable "myText" just contains pure text.
But, if the variable contains a html table with break after the
<table> tag, <tr> tag and <td> tag, the table will not come in the top
of the page as I wanted.

My question:
Is there any smart way to "turn off" the replace-function just around
the <table> content in the myText-variable?

The above function is only usefull to convert a "paragraphed text" to html.

Converting html, containing <td>, etc., with it is nonsense,
as the carriage returns do not correspondent to a new line in the browser.

Secondly, better use this as on windows platforma [ASP] the new line is
Chr(13)&Chr(10), and that is VbCrLf:

result = replace(myText,VbCrLf,"<br>")
 
D

Dave Anderson

Øyvind Isaksen said:
My question:
Is there any smart way to "turn off" the replace-function just around
the <table> content in the myText-variable?

Use the Replace method of the Regular Expression Object...
http://msdn.microsoft.com/library/en-us/script56/html/810607c5-5926-43d9-b7e8-4126e97000d2.asp


....rather than the Replace Function:
http://msdn.microsoft.com/library/en-us/script56/html/65e15b2c-99b6-4f82-88e7-8c657489dd34.asp




--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top