StringBuilder.Insert Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Insert(Int32, String, Int32, Int32) | |
| Insert(Int32, ICharSequence) |
Inserts the string representation of the specified |
| Insert(Int32, Object) |
Inserts the string representation of the specified |
| Insert(Int32, Boolean) |
Inserts the string representation of the specified |
| Insert(Int32, Char) |
Inserts the string representation of the specified |
| Insert(Int32, Char[]) |
Inserts the string representation of the specified |
| Insert(Int32, Double) |
Inserts the string representation of the specified |
| Insert(Int32, Int32) |
Inserts the string representation of the specified |
| Insert(Int32, Int64) |
Inserts the string representation of the specified |
| Insert(Int32, Single) |
Inserts the string representation of the specified |
| Insert(Int32, String) |
Inserts the specified string at the specified |
| Insert(Int32, ICharSequence, Int32, Int32) |
Inserts the string representation of the specified subsequence of the
|
| Insert(Int32, Char[], Int32, Int32) |
Inserts the string representation of the specified subsequence of the
|
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
- s
- String
- start
- Int32
- end
- Int32
Returns
Remarks
Java documentation for java.lang.StringBuilder.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)
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);
[<Android.Runtime.Register("insert", "(ILjava/lang/CharSequence;)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * Java.Lang.ICharSequence -> Java.Lang.StringBuilder
Parameters
- dstOffset
- Int32
the CharSequence to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length().
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(ILjava/lang/Object;)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * Java.Lang.Object -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- obj
- Object
the Object to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length().
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(IZ)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * bool -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- b
- Boolean
the boolean value to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length.
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(IC)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * char -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- c
- Char
the char value to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length().
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(I[C)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * char[] -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- str
- Char[]
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length().
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(ID)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * double -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- d
- Double
the double value to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length().
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(II)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * int -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- i
- Int32
the int value to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length().
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(IJ)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * int64 -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- l
- Int64
the long value to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
{code length()}.
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(IF)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * single -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- f
- Single
the float value to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length().
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
Applies to
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);
[<Android.Runtime.Register("insert", "(ILjava/lang/String;)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * string -> Java.Lang.StringBuilder
Parameters
- offset
- Int32
the index to insert at.
- str
- String
the String to insert.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length().
Remarks
Java documentation for java.lang.StringBuilder.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)
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);
[<Android.Runtime.Register("insert", "(ILjava/lang/CharSequence;II)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * Java.Lang.ICharSequence * int * int -> Java.Lang.StringBuilder
Parameters
- dstOffset
- Int32
the CharSequence to insert.
- start
- Int32
the start of the subsequence of the character sequence.
- end
- Int32
the end of the subsequence of the character sequence.
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length(), or start and end do not
specify a valid subsequence.
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
- <xref:Java.Lang.ICharSequence.SubSequenceFormatted(System.Int32%2c+System.Int32)>
Applies to
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);
[<Android.Runtime.Register("insert", "(I[CII)Ljava/lang/StringBuilder;", "")>]
member this.Insert : int * char[] * int * int -> Java.Lang.StringBuilder
Parameters
- index
- Int32
- str
- Char[]
the char[] to insert.
- offset
- Int32
the index to insert at.
- len
- Int32
Returns
- Attributes
Exceptions
if offset is negative or greater than the current
length(), or strOffset and strLen do
not specify a valid subsequence.
Remarks
Java documentation for java.lang.StringBuilder.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.
See also
- <xref:Java.Lang.String.ValueOf(System.Char%5b%5d%2c+System.Int32%2c+System.Int32)>