A
Anat
Hi,
I need a little help on performing string manipulation:
I want to take a given string, and make certain words hyperlinks.
For example:
"Hello world, this is a wonderful day!"
I'd like the words world & and day to be hyperlinks, therefore
after my manipulation it should be:
"Hello <a href=...>world</a>, this is a wonderful <a href=...>day</a>!"
Using split method is not good, because splitting with regex each
punctuation mark causes the commas and other punctuation marks to
disappear.
Instead of displaying
"Hello <a href=...>world</a>, this is a wonderful <a href=...>day</a>!"
I will display
"Hello <a href=...>world</a> this is a wonderful <a href=...>day</a>"
(note that the comma and exclamation mark are gone).
Any ideas on how I can locate words, replace them but not loose
punctuation marks on the way?
Thanks a lot!!!
Anat.
I need a little help on performing string manipulation:
I want to take a given string, and make certain words hyperlinks.
For example:
"Hello world, this is a wonderful day!"
I'd like the words world & and day to be hyperlinks, therefore
after my manipulation it should be:
"Hello <a href=...>world</a>, this is a wonderful <a href=...>day</a>!"
Using split method is not good, because splitting with regex each
punctuation mark causes the commas and other punctuation marks to
disappear.
Instead of displaying
"Hello <a href=...>world</a>, this is a wonderful <a href=...>day</a>!"
I will display
"Hello <a href=...>world</a> this is a wonderful <a href=...>day</a>"
(note that the comma and exclamation mark are gone).
Any ideas on how I can locate words, replace them but not loose
punctuation marks on the way?
Thanks a lot!!!
Anat.