Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

usage of stringbuffer length.

 
sowmya vasisht
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anybody help me in knowing how to truncate Stringbuffer elements when it exceeds some predetermined legnth without loosing data.
first in a while loop of vector i m appending the account number, then the account status to a string buffer. but when the length of the string buffer exceeds a predetermined length, for eg., if the legnth has to be 400, then if the addition of accoutn number and status is more than 400 then it should remove the last added number and status. and pass the data which is less than 400 or equal to.
Could anybody tel me how to go about it??
thanx in advance.
sowmya
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sowmya,
You can try something like this:

Hope this helps,
Michael Morris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic