how to truncate the subject into "..." in JSP?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Kenny_C
Posted On:   Monday, January 20, 2003 07:31 PM

I want to know how to change a very long <%=subject%> into a shorter subject such as "I am ... " using " ... " at the end of the subject.


I am using JSP

thanks

Re: how to truncate the subject into "..." in JSP?

Posted By:   Brian_Glodde  
Posted On:   Monday, January 20, 2003 07:37 PM

Something like this maybe?



static final MAXLEN = 35;

if( subject.length() => MAXLEN )
{
subject = subject.substring( 1, MAXLEN ) + "...";
}


Hope that works ;)
About | Sitemap | Contact