| Author |
how to trim a StringBuffer??!!
|
Bharat Macwana
Greenhorn
Joined: May 31, 2007
Posts: 3
|
|
Hi Ranchers!!
is this the best way to trim a StringBuffer?
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
|
In your code, you are trimming the string and not the buffer.
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32691
|
|
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.
|
 |
 |
|
|
subject: how to trim a StringBuffer??!!
|
|
|