• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Html tag content wrapping

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.




 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic