Limited text output

How would I limit the amount of html characters printed to a page, so that it only displays say 50?

So if the html generates a 100 characters in a paragraph, how would I limit that to 50 and add a link "more.." to the string?

many thanks.
LVL 18
Eternal_StudentAsked:
Who is Participating?
 
mbvvsatishCommented:
0
 
mbvvsatishCommented:
you can use str.substring(0,50); with out.println (servlet/jsp) or with document.write() [javascript]
 
0
 
Eternal_StudentAuthor Commented:
What about using JSTL?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.