Re: Help: how to cut html strings
Re: Help: how to cut html strings
- Subject: Re: Help: how to cut html strings
- From: Dev WO <email@hidden>
- Date: Tue, 23 May 2006 11:23:01 +0200
Hello Amedeo,
here's what I've done on my side, assuming I don't want any word to
be cropped but you can remove this part:
you will need:
import org.apache.commons.lang.*; //From Apache
import org.clapper.util.text.*; // From http://www.clapper.org/
public static String stripHTMLTagsAndConcatenate(String htmlString,
int numberOfChar) {
return (StringUtils.substringBeforeLast
(StringUtils.abbreviate((HTMLUtil.stripHTMLTags(htmlString)),
numberOfChar), " ")) + "...";
}
So this is in my framework.
Hope this help
Xavier
Hello, in my application i need sometimes to display a WOString
reducing dysplayed caracthers to about 200.
I have my own class that cut the string, nut now I have this
problem...
The string that I'm goung to cut is an HTML string, simply cutting
it probably I break some closing tags therefore I got a bad
rendered html.
do you know how to cut text leaving tags uncutted?
obviously my WOString have HTMLespace binding setted to false.
thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anazys.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden