• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Html tag content wrapping

 
seena mathew
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to wrap dynamic text based on number of characters(say for eg 5 characters in a line) in java.
So for example if the input Text is following, I need to do wrapping of text part only on
"Click me blh blah blah blah .... " and the other surrounding tags should be retained.

<b> <i><a href="http://www.google.com" target="_blank"> Click me blh blah blah blah .... </a> </i> </b>




I have tried writing code but have ended up getting so confused that I am not aware of what i am doing also


Code snippet

Any suggestions would be of great help.




 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like:

String message = ...
if(the length of message is bigger than maxlength)
get the substring of message from 0 to maxlength
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic