Hehe, nasty! :-)

I suggest doing it in one replaceAll though:

text.replaceAll("<[^>]*>", "*")

This has the added benefit of correctly treating unexpected and as yet unknown tags, and thus is more future proof!

Regards,
Sebastiaan

Martijn Dashorst wrote:
this should get what you want:
add(new Label("foo", text.replaceAll("<b>", "*")
    .replaceAll("</b>", "*")
    .replaceAll("<i>", "*")
    .replaceAll("</i>", "*")));

Martijn

On 11/12/07, Francisco Diaz Trepat - gmail
<[EMAIL PROTECTED]> wrote:
Hi, I have a Label who's model maight come with markup for bold italic,
bullets, etc. (e.g. "<b>This</b> is a <i>Message</i>")

Obviously I get "<b>This</b> is a <i>Message</i>" rendered.

Is there a way to get the label to render:

"*This* is a *Message*"

thanks,
f(t)



Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to