Simply awesomeThe #1 ASP/ASP.NET Developer Community

StringBuilder.Insert Method ( Int32, Char [ ], Int32, Int32 )

System.Text Namespace   StringBuilder Class


Inserts the string representation of a specified subarray of Unicode characters into this instance at the specified character position.

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

[ C# ]
[Serializable]
public StringBuilder Insert ( 
   int index,
   char [ ] value,
   int startIndex,
   int charCount
);

[ C++ ]
[Serializable]
public: StringBuilder* Insert ( 
   int index,
   __wchar_t value __gc [ ],
   int startIndex,
   int charCount
);

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

Parameters

index
The position at which to insert.
value
A character array.
startIndex
The starting index within value.
charCount
The number of characters to insert.

Return Value

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

Exceptions


Exception Type Condition
ArgumentNullException value is a null reference ( Nothing in Visual Basic ), and startIndex and charCount are not zero.
ArgumentOutOfRangeException index, startIndex, or charCount is less than zero.

-or-

index is greater than the length of this instance.

-or-

startIndex plus charCount is not a position within value.


Remarks

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

See Also

StringBuilder Members   StringBuilder.Insert Overload List   Char


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