• 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

usage of stringbuffer length.

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi sowmya,
You can try something like this:

Hope this helps,
Michael Morris
reply
    Bookmark Topic Watch Topic
  • New Topic