Share via


Insert Method (Int32, String, Int32)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Inserts one or more copies of a specified string into this instance at the specified character position.

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Function Insert ( _
    index As Integer, _
    value As String, _
    count As Integer _
) As StringBuilder
public StringBuilder Insert(
    int index,
    string value,
    int count
)
public:
StringBuilder^ Insert(
    int index, 
    String^ value, 
    int count
)
member Insert : 
        index:int * 
        value:string * 
        count:int -> StringBuilder 
public function Insert(
    index : int, 
    value : String, 
    count : int
) : StringBuilder

Parameters

Return Value

Type: System.Text. . :: . .StringBuilder
A reference to this instance after insertion has completed.

Remarks

Existing characters are shifted to make room for the new text. The capacity of this instance is adjusted as needed.

This StringBuilder object is not changed if value is null Nothing nullptr unit a null reference (Nothing in Visual Basic) , value is not null Nothing nullptr unit a null reference (Nothing in Visual Basic) but its length is zero, or count is zero.

.NET Framework Security

See Also

Reference

StringBuilder Class

Insert Overload

System.Text Namespace