File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
coversion of String buffer
Angela Jessi
Ranch Hand
Joined: Nov 27, 2000
Posts: 428
posted
Feb 15, 2001 10:05:00
0
Hi,
I want to know the syntax to convert
String
buffer to String...
Thanks,
angela
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
Feb 15, 2001 10:08:00
0
Here's an example:
StringBuffer buf = new StringBuffer(); buf.append("Hello,"); buf.append("World\n"); String ret = buf.toString();
A Convergent Visionary
~
Frank's Punchbarrel Blog
~
LinkedIn profile
Antonio Lopez
Greenhorn
Joined: Feb 04, 2001
Posts: 1
posted
Feb 15, 2001 10:54:00
0
The overriding method toString() in the stringbuffer class, return the encapsulated string as an instance of class String.
The code bellow shows how to do this:
1.
StringBuffer
sbuf=new
StringBuffer
("Hello");
2. String st=sbuf.toString();
Angela Jessi
Ranch Hand
Joined: Nov 27, 2000
Posts: 428
posted
Feb 15, 2001 13:53:00
0
Thanks a bunch Antonio,Frank
Angela
I agree. Here's the link:
http://aspose.com/file-tools
subject: coversion of String buffer
Similar Threads
how to trim a StringBuffer??!!
Diff between string and string buffer
what is difference in string and string buffer
String Vs String Buffer
Searching hashmap for array String [] occurences?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter