You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "louis@ironpulse" <lo...@ironpulse.com> on 2003/07/16 22:30:55 UTC

truncating text with JSTL

Im trying to find out if there are any string manipulation functions in
jstl because im tryong to truncate a sentence for example i want to only
display the first 10 characters of a sentence.

Im looking for something that would allow me to do something like <c:out
value="{$left(sentence,10)}" />

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: truncating text with JSTL

Posted by Serge Knystautas <se...@lokitech.com>.
louis@ironpulse wrote:
> Im trying to find out if there are any string manipulation functions in
> jstl because im tryong to truncate a sentence for example i want to only
> display the first 10 characters of a sentence.
> 
> Im looking for something that would allow me to do something like <c:out
> value="{$left(sentence,10)}" />

JSP 2.0 introduces functions, and JSTL 1.1 defines several standard 
functions, including a substring one.  The specs aren't final though, so 
I don't have a great suggestion on how to do it today.  In a couple of 
months though I'd expect the servlet engines will have it ready to use.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: truncating text with JSTL

Posted by Jeff Wilder <Je...@puma.com>.
Check out the string taglibs.

http://jakarta.apache.org/taglibs/doc/string-doc/intro.html





"louis@ironpulse" <lo...@ironpulse.com> 
07/16/2003 04:30 PM
Please respond to
"Tag Libraries Users List" <ta...@jakarta.apache.org>


To
taglibs-user@jakarta.apache.org
cc

Subject
truncating text with JSTL






Im trying to find out if there are any string manipulation functions in
jstl because im tryong to truncate a sentence for example i want to only
display the first 10 characters of a sentence.

Im looking for something that would allow me to do something like <c:out
value="{$left(sentence,10)}" />

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org