• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to trim a StringBuffer??!!  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers!!

is this the best way to trim a StringBuffer?

 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your code, you are trimming the string and not the buffer.
 
Marshal
Posts: 57244
175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean s.trim(), surely?

you should usually use StringBuilder instead, and there appears to be a suitable method if you look through its documentation.
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!