StringBuilder.Insert StringBuilder.Insert Method

Definition

Overloads

Insert(Int32, ICharSequence) Insert(Int32, ICharSequence)

Inserts the string representation of the specified CharSequence at the specified offset.

Insert(Int32, Object) Insert(Int32, Object)

Inserts the string representation of the specified Object at the specified offset.

Insert(Int32, Boolean) Insert(Int32, Boolean)

Inserts the string representation of the specified boolean value at the specified offset.

Insert(Int32, Char) Insert(Int32, Char)

Inserts the string representation of the specified char value at the specified offset.

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

Inserts the string representation of the specified char[] at the specified offset.

Insert(Int32, Double) Insert(Int32, Double)

Inserts the string representation of the specified double value at the specified offset.

Insert(Int32, Int32) Insert(Int32, Int32)

Inserts the string representation of the specified int value at the specified offset.

Insert(Int32, Int64) Insert(Int32, Int64)

Inserts the string representation of the specified long value at the specified offset.

Insert(Int32, Single) Insert(Int32, Single)

Inserts the string representation of the specified float value at the specified offset.

Insert(Int32, String) Insert(Int32, String)

Inserts the specified string at the specified offset.

Insert(Int32, ICharSequence, Int32, Int32) Insert(Int32, ICharSequence, Int32, Int32)

Inserts the string representation of the specified subsequence of the CharSequence at the specified offset.

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

Inserts the string representation of the specified subsequence of the char[] at the specified offset.

Insert(Int32, String, Int32, Int32) Insert(Int32, String, Int32, Int32)

Insert(Int32, ICharSequence) Insert(Int32, ICharSequence)

Inserts the string representation of the specified CharSequence at the specified offset.

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

Parameters

dstOffset
Int32 Int32
s
ICharSequence ICharSequence

the CharSequence to insert.

Returns

Exceptions

if offset is negative or greater than the current length().

Remarks

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.

See also

Insert(Int32, Object) Insert(Int32, Object)

Inserts the string representation of the specified Object at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

obj
Object Object

the Object to insert.

Returns

Exceptions

if offset is negative or greater than the current length().

Remarks

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.

See also

Insert(Int32, Boolean) Insert(Int32, Boolean)

Inserts the string representation of the specified boolean value at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

b
Boolean Boolean

the boolean value to insert.

Returns

Exceptions

if offset is negative or greater than the current length.

Remarks

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.

See also

Insert(Int32, Char) Insert(Int32, Char)

Inserts the string representation of the specified char value at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

c
Char Char

the char value to insert.

Returns

Exceptions

if offset is negative or greater than the current length().

Remarks

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.

See also

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

Inserts the string representation of the specified char[] at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

str
Char[]

Returns

Exceptions

if offset is negative or greater than the current length().

Remarks

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.

See also

Insert(Int32, Double) Insert(Int32, Double)

Inserts the string representation of the specified double value at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

d
Double Double

the double value to insert.

Returns

Exceptions

if offset is negative or greater than the current length().

Remarks

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.

See also

Insert(Int32, Int32) Insert(Int32, Int32)

Inserts the string representation of the specified int value at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

i
Int32 Int32

the int value to insert.

Returns

Exceptions

if offset is negative or greater than the current length().

Remarks

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.

See also

Insert(Int32, Int64) Insert(Int32, Int64)

Inserts the string representation of the specified long value at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

l
Int64 Int64

the long value to insert.

Returns

Exceptions

if offset is negative or greater than the current {code length()}.

Remarks

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.

See also

Insert(Int32, Single) Insert(Int32, Single)

Inserts the string representation of the specified float value at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

f
Single Single

the float value to insert.

Returns

Exceptions

if offset is negative or greater than the current length().

Remarks

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.

See also

Insert(Int32, String) Insert(Int32, String)

Inserts the specified string at the specified offset.

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

Parameters

offset
Int32 Int32

the index to insert at.

str
String String

the String to insert.

Returns

Exceptions

if offset is negative or greater than the current length().

Remarks

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.

Insert(Int32, ICharSequence, Int32, Int32) Insert(Int32, ICharSequence, Int32, Int32)

Inserts the string representation of the specified subsequence of the CharSequence at the specified offset.

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

Parameters

dstOffset
Int32 Int32
s
ICharSequence ICharSequence

the CharSequence to insert.

start
Int32 Int32

the start of the subsequence of the character sequence.

end
Int32 Int32

the end of the subsequence of the character sequence.

Returns

Exceptions

if offset is negative or greater than the current length(), or start and end do not specify a valid subsequence.

Remarks

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.

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

Inserts the string representation of the specified subsequence of the char[] at the specified offset.

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

Parameters

index
Int32 Int32
str
Char[]

the char[] to insert.

offset
Int32 Int32

the index to insert at.

len
Int32 Int32

Returns

Exceptions

if offset is negative or greater than the current length(), or strOffset and strLen do not specify a valid subsequence.

Remarks

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.

Insert(Int32, String, Int32, Int32) Insert(Int32, String, Int32, Int32)

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

Parameters

dstOffset
Int32 Int32
start
Int32 Int32
end
Int32 Int32

Returns

Remarks

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