text manipulation

J

jack-e

Hi,

Senario: I'm retrieving some text from a database and when I display
this text on my page I want the first paragraph to be a different
color.

Do I need to break up the values i.e. find where <br><br> occurs and
substring up to this point. Then have two labels on the form??

or is there an easier method?

Thanks!

Jack
 
L

Lucas Tam

Hi,

Senario: I'm retrieving some text from a database and when I display
this text on my page I want the first paragraph to be a different
color.

Do I need to break up the values i.e. find where <br><br> occurs and
substring up to this point. Then have two labels on the form??

Depending on how complex the search is, Regular expressions maybe a better
choice than substrings.

As for color coding, you can try:

-Style sheets, assign each paragraph to their own CSS class
-Rather than use two labels, you can just append some HTML to the database
text and place the results into a literal.

But in short, using two labels works just as well : )
 
J

jack-e

do you know how would i use a regular expression to find when a
paragraph finishes? (or begins?)
 
O

Oliver Wong

jack-e said:
do you know how would i use a regular expression to find when a
paragraph finishes? (or begins?)

Depends entirely on how the paragraphs are encoded. Earlier you implied
two consecutive <br> tags, for example. Whenever I write paragraphs in HTML,
I enclose them in <p> and </p>, so looking for two <br> tags would not work
with my data.

- Oliver.
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top