Saturday, March 24, 2012

text manipulation

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"jack-e" <jack-b@.humlog.com> wrote in news:1123565399.992699.270660
@.g47g2000cwa.googlegroups.com:

> 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 : )

--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
do you know how would i use a regular expression to find when a
paragraph finishes? (or begins?)
"jack-e" <jack-b@.humlog.com> wrote in message
news:1123568497.239674.83420@.z14g2000cwz.googlegro ups.com...
> 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.

0 comments:

Post a Comment