Android Guides | Samples

Java.Lang.StringBuffer Class

A modifiable ICharSequence for use in creating strings, where all accesses are synchronized.

See Also: StringBuffer

Syntax

[Android.Runtime.Register("java/lang/StringBuffer", DoNotGenerateAcw=true)]
public sealed class StringBuffer : AbstractStringBuilder, ISerializable, IEnumerable<char>, IDisposable

Remarks

A modifiable ICharSequence for use in creating strings, where all accesses are synchronized. This class has mostly been replaced by StringBuilder because this synchronization is rarely useful. This class is mainly used to interact with legacy APIs that expose it.

For particularly complex string-building needs, consider Formatter.

The majority of the modification methods on this class return this so that method calls can be chained together. For example: new StringBuffer("a").append("b").append("c").toString().

See Also

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Lang.StringBuffer are listed below.

See Also: AbstractStringBuilder

Public Constructors

Constructs a new StringBuffer using the default capacity which is 16.
Constructs a StringBuffer and initializes it with the content from the specified CharSequence.
Constructs a new StringBuffer using the specified capacity.
Constructs a new StringBuffer containing the characters in the specified string.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

override
Append(ICharSequence) : IAppendable
Appends the specified CharSequence to this buffer.
Append(Object) : IAppendable
Adds the string representation of the specified object to the end of this StringBuffer.
Append(StringBuffer) : IAppendable
Adds the specified StringBuffer to the end of this buffer.
Append(Boolean) : IAppendable
Adds the string representation of the specified boolean to the end of this StringBuffer.
override
Append(Char) : IAppendable
Adds the specified character to the end of this buffer.
Append(Char[]) : IAppendable
Adds the character array to the end of this buffer.
Append(Double) : IAppendable
Adds the string representation of the specified double to the end of this StringBuffer.
Append(Int32) : IAppendable
Adds the string representation of the specified integer to the end of this StringBuffer.
Append(Int64) : IAppendable
Adds the string representation of the specified long to the end of this StringBuffer.
Append(Single) : IAppendable
Adds the string representation of the specified float to the end of this StringBuffer.
Append(String) : IAppendable
Adds the specified string to the end of this buffer.
override
Append(ICharSequence, Int32, Int32) : IAppendable
Appends the specified subsequence of the CharSequence to this buffer.
Append(Char[], Int32, Int32) : IAppendable
Adds the specified sequence of characters to the end of this buffer.
AppendCodePoint(Int32) : StringBuffer
Appends the string representation of the specified Unicode code point to the end of this buffer.
override
Capacity() : Int32
Returns the number of characters that can be held without growing.
override
CharAt(Int32) : Char
Returns the character at index.
override
CodePointAt(Int32) : Int32
Retrieves the Unicode code point value at the index.
override
CodePointBefore(Int32) : Int32
Retrieves the Unicode code point value that precedes the index.
override
CodePointCount(Int32, Int32) : Int32
Calculates the number of Unicode code points between start and end.
Delete(Int32, Int32) : StringBuffer
Deletes a range of characters.
DeleteCharAt(Int32) : StringBuffer
Deletes the character at the specified offset.
override
EnsureCapacity(Int32)
Ensures that this object has a minimum capacity available before requiring the internal buffer to be enlarged.
override
GetChars(Int32, Int32, Char[], Int32)
Copies the requested sequence of characters to the char[] passed starting at idx.
GetEnumerator() : IEnumerator<char>
override
IndexOf(String) : Int32
Searches for the first index of the specified character.
override
IndexOf(String, Int32) : Int32
Searches for the index of the specified character.
Insert(Int32, ICharSequence) : StringBuffer
Inserts the specified CharSequence into this buffer at the specified index.
Insert(Int32, Object) : StringBuffer
Inserts the string representation of the specified object into this buffer at the specified offset.
Insert(Int32, Boolean) : StringBuffer
Inserts the string representation of the specified boolean into this buffer at the specified offset.
Insert(Int32, Char) : StringBuffer
Inserts the character into this buffer at the specified offset.
Insert(Int32, Char[]) : StringBuffer
Inserts the character array into this buffer at the specified offset.
Insert(Int32, Double) : StringBuffer
Inserts the string representation of the specified into this buffer double at the specified offset.
Insert(Int32, Int32) : StringBuffer
Inserts the string representation of the specified integer into this buffer at the specified offset.
Insert(Int32, Int64) : StringBuffer
Inserts the string representation of the specified long into this buffer at the specified offset.
Insert(Int32, Single) : StringBuffer
Inserts the string representation of the specified float into this buffer at the specified offset.
Insert(Int32, String) : StringBuffer
Inserts the string into this buffer at the specified offset.
Insert(Int32, ICharSequence, Int32, Int32) : StringBuffer
Inserts the specified subsequence into this buffer at the specified index.
Insert(Int32, Char[], Int32, Int32) : StringBuffer
Inserts the specified subsequence of characters into this buffer at the specified index.
Insert(Int32, String, Int32, Int32) : StringBuffer
override
LastIndexOf(String) : Int32
Searches for the last index of the specified character.
override
LastIndexOf(String, Int32) : Int32
Searches for the index of the specified character.
override
Length() : Int32
The current length.
override
OffsetByCodePoints(Int32, Int32) : Int32
Returns the index that is offset codePointOffset code points from index.
Replace(Int32, Int32, String) : StringBuffer
Replaces the characters in the specified range with the contents of the specified string.
Reverse() : StringBuffer
Reverses the order of characters in this buffer.
override
SetCharAt(Int32, Char)
Sets the character at the index.
override
SetLength(Int32)
Sets the current length to a new value.
SubSequence(Int32, Int32) : String
override
SubSequenceFormatted(Int32, Int32) : ICharSequence
Returns a CharSequence of the subsequence from the start index to the end index.
override
Substring(Int32) : String
Returns the String value of the subsequence from the start index to the current end.
override
Substring(Int32, Int32) : String
Returns the String value of the subsequence from the start index to the end index.
override
ToString() : String
Returns the current String representation.
override
TrimToSize()
Trims off any extra capacity beyond the current length.

Explicitly Implemented Interface Members