Simply awesomeThe #1 ASP/ASP.NET Developer Community

StringBuilder.Insert Method ( Int32, Object )

System.Text Namespace   StringBuilder Class


Inserts the string representation of an object into this instance at the specified character position.

[ VB ]
<Serializable>
Overloads Public Function Insert ( _
   ByVal index As Integer, _
   ByVal value As Object _
) As StringBuilder

[ C# ]
[Serializable]
public StringBuilder Insert ( 
   int index,
   object value
);

[ C++ ]
[Serializable]
public: StringBuilder* Insert ( 
   int index,
   Object* value
);

[ JScript ]
public Serializable
function Insert ( 
   index : int,
   value : Object
) : StringBuilder;

Parameters

index
The position at which to insert.
value
The object to insert or a null reference ( Nothing in Visual Basic ).

Return Value

A reference to this instance after the insert operation has occurred.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException index is greater than the length of this instance.

-or-

index is less than zero.


Remarks

ToString is used to get a string representation of value. Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.

If value is a null reference ( Nothing in Visual Basic ), the value of this instance is unchanged.

See Also

StringBuilder Members   StringBuilder.Insert Overload List   Object


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note