StringBuffer.Insert Method

Definition

Overloads

Name Description
Insert(Int32, String, Int32, Int32)

Added in 1.

Insert(Int32, ICharSequence)

Added in 1.

Insert(Int32, Object)

Inserts the string representation of the specified object into this buffer at the specified offset.

Insert(Int32, Boolean)

Inserts the string representation of the specified boolean into this buffer at the specified offset.

Insert(Int32, Char)

Inserts the character into this buffer at the specified offset.

Insert(Int32, Char[])

Inserts the character array into this buffer at the specified offset.

Insert(Int32, Double)

Inserts the string representation of the specified into this buffer double at the specified offset.

Insert(Int32, Int32)

Inserts the string representation of the specified integer into this buffer at the specified offset.

Insert(Int32, Int64)

Inserts the string representation of the specified long into this buffer at the specified offset.

Insert(Int32, Single)

Inserts the string representation of the specified float into this buffer at the specified offset.

Insert(Int32, String)

Inserts the string into this buffer at the specified offset.

Insert(Int32, ICharSequence, Int32, Int32)

Added in 1.

Insert(Int32, Char[], Int32, Int32)

Added in 1.

Insert(Int32, String, Int32, Int32)

Added in 1.

public Java.Lang.StringBuffer Insert(int dstOffset, string? s, int start, int end);
member this.Insert : int * string * int * int -> Java.Lang.StringBuffer

Parameters

dstOffset
Int32

The index at which to insert the characters.

s
String

The character sequence to insert.

start
Int32

The inclusive start index of the range.

end
Int32

The exclusive end index of the range.

Returns

This character sequence after the insertion.

Remarks

Added in 1.5.

Java documentation for java.lang.StringBuffer.insert(int, java.lang.CharSequence, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, ICharSequence)

Added in 1.

[Android.Runtime.Register("insert", "(ILjava/lang/CharSequence;)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int dstOffset, Java.Lang.ICharSequence? s);
[<Android.Runtime.Register("insert", "(ILjava/lang/CharSequence;)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * Java.Lang.ICharSequence -> Java.Lang.StringBuffer

Parameters

dstOffset
Int32

The index at which to insert the characters.

s
ICharSequence

The char sequence to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Added in 1.5.

Java documentation for java.lang.StringBuffer.insert(int, java.lang.CharSequence).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Object)

Inserts the string representation of the specified object into this buffer at the specified offset.

[Android.Runtime.Register("insert", "(ILjava/lang/Object;)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, Java.Lang.Object? obj);
[<Android.Runtime.Register("insert", "(ILjava/lang/Object;)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * Java.Lang.Object -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

obj
Object

the object to insert (may be null).

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Java documentation for java.lang.StringBuffer.insert(int, java.lang.Object).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Boolean)

Inserts the string representation of the specified boolean into this buffer at the specified offset.

[Android.Runtime.Register("insert", "(IZ)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, bool b);
[<Android.Runtime.Register("insert", "(IZ)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * bool -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

b
Boolean

the boolean to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Java documentation for java.lang.StringBuffer.insert(int, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Char)

Inserts the character into this buffer at the specified offset.

[Android.Runtime.Register("insert", "(IC)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, char c);
[<Android.Runtime.Register("insert", "(IC)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * char -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

c
Char

The character to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Java documentation for java.lang.StringBuffer.insert(int, char).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Char[])

Inserts the character array into this buffer at the specified offset.

[Android.Runtime.Register("insert", "(I[C)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, char[]? str);
[<Android.Runtime.Register("insert", "(I[C)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * char[] -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

str
Char[]

The string to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

if chars is null.

Remarks

Java documentation for java.lang.StringBuffer.insert(int, char[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Double)

Inserts the string representation of the specified into this buffer double at the specified offset.

[Android.Runtime.Register("insert", "(ID)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, double d);
[<Android.Runtime.Register("insert", "(ID)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * double -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

d
Double

the double to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Java documentation for java.lang.StringBuffer.insert(int, double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Int32)

Inserts the string representation of the specified integer into this buffer at the specified offset.

[Android.Runtime.Register("insert", "(II)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, int i);
[<Android.Runtime.Register("insert", "(II)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * int -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

i
Int32

the integer to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Java documentation for java.lang.StringBuffer.insert(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Int64)

Inserts the string representation of the specified long into this buffer at the specified offset.

[Android.Runtime.Register("insert", "(IJ)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, long l);
[<Android.Runtime.Register("insert", "(IJ)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * int64 -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

l
Int64

the long to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Java documentation for java.lang.StringBuffer.insert(int, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Single)

Inserts the string representation of the specified float into this buffer at the specified offset.

[Android.Runtime.Register("insert", "(IF)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, float f);
[<Android.Runtime.Register("insert", "(IF)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * single -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

f
Single

the float to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Java documentation for java.lang.StringBuffer.insert(int, float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, String)

Inserts the string into this buffer at the specified offset.

[Android.Runtime.Register("insert", "(ILjava/lang/String;)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int offset, string? str);
[<Android.Runtime.Register("insert", "(ILjava/lang/String;)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * string -> Java.Lang.StringBuffer

Parameters

offset
Int32

The offset at which the operation is performed.

str
String

The string to insert.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index or index > length().

Remarks

Java documentation for java.lang.StringBuffer.insert(int, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, ICharSequence, Int32, Int32)

Added in 1.

[Android.Runtime.Register("insert", "(ILjava/lang/CharSequence;II)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int dstOffset, Java.Lang.ICharSequence? s, int start, int end);
[<Android.Runtime.Register("insert", "(ILjava/lang/CharSequence;II)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * Java.Lang.ICharSequence * int * int -> Java.Lang.StringBuffer

Parameters

dstOffset
Int32

The index at which to insert the characters.

s
ICharSequence

The char sequence to insert.

start
Int32

The inclusive start index in the char sequence.

end
Int32

The exclusive end index in the char sequence.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if index is negative or greater than the current length, start or end are negative, start is greater than end or end is greater than the length of s.

Remarks

Added in 1.5.

Java documentation for java.lang.StringBuffer.insert(int, java.lang.CharSequence, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Insert(Int32, Char[], Int32, Int32)

Added in 1.

[Android.Runtime.Register("insert", "(I[CII)Ljava/lang/StringBuffer;", "")]
public Java.Lang.StringBuffer Insert(int index, char[]? str, int offset, int len);
[<Android.Runtime.Register("insert", "(I[CII)Ljava/lang/StringBuffer;", "")>]
member this.Insert : int * char[] * int * int -> Java.Lang.StringBuffer

Parameters

index
Int32

the index at which to insert.

str
Char[]

The string to insert.

offset
Int32

The offset at which the operation is performed.

len
Int32

The number of elements to process.

Returns

This character sequence after the insertion.

Attributes

Exceptions

if chars is null.

if length , start , start + length > chars.length, index or index > length()

Remarks

Added in 1.2.

Java documentation for java.lang.StringBuffer.insert(int, char[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to