View RSS Feed

Java String

StringBuffer Functions

Rate this Entry
by , 04-26-2012 at 07:38 PM (810 Views)
Few StringBuffer methods has many uses which is being explained by the following program:

1. capacity()
String buffer’s current capacity is returned.

2. length()
String buffer’s length is returned.

3. charAt(int index)
Specified sequence character which is presented by string buffer are returned.

4. setCharAt(int index, char ch)
At specified index, the character of this string buffer has been set to ch

5. toString()
Gets converted to String presenting data which is there in string buffer.

6. insert(int offset, char c)
String presentation is inserted, of char argument, to string buffer.

7. delete(int start, int end)
characters which are present in a StringBuffer’s substring are removed.

8. replace(int start, int end, String str)
Replaces those characters which are present in a StringBuffer’s substring, with characters which are there in the specified String.

9. reverse()
In string buffer, character sequence is present which is replaced by sequence reverse.

10. append(String str)
string is appended to this string buffer.

11. setLength(int newLength)
Sets this String buffer’s length.

Submit "StringBuffer Functions" to Facebook Submit "StringBuffer Functions" to Digg Submit "StringBuffer Functions" to Submit "StringBuffer Functions" to StumbleUpon Submit "StringBuffer Functions" to Google