• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting break tag in a StringBuilder  RSS feed

 
N Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've already been given an example of how to do something like that here
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!