aspose file tools
The moose likes Java in General and the fly likes Inserting break tag  in a StringBuilder Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Inserting break tag  in a StringBuilder" Watch "Inserting break tag  in a StringBuilder" New topic
Author

Inserting break tag in a StringBuilder

N Naresh
Ranch Hand

Joined: Nov 04, 2008
Posts: 66
hi i want to insert a <br> in StringBuilder after certain number of characters
suppose if the StringBuilder is like ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ

how i can write the logic to insert <br> at more than one place in above StringBuilder content
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
You've already been given an example of how to do something like that here


Joanne
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
after you insert "<br/>" at location N,
keep scanning the string for the need for more at index N+ (length of "<br/>")
until you get to the end,


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Inserting break tag in a StringBuilder
 
Similar Threads
How to make scrollable table scroll to a specific row
"a name" tag
Dynamically Scrolling to the newly added row in HTML table.
How to control anchor display position
inserting line break in <h:outputText> value