NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

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

Inserts a subarray of unicode characters into the current StringBuilder at the specified position.

[Visual Basic]
Overloads Public Function Insert( _
   ByVal index As Integer, _
   ByVal value() As Char, _
   ByVal startIndex As Integer, _
   ByVal charCount As Integer _
) As StringBuilder
[C#]
public StringBuilder Insert(
   int index,
   char[] value,
   int startIndex,
   int charCount
);
[C++]
public: StringBuilder* Insert(
   int index,
   __wchar_t* value[],
   int startIndex,
   int charCount
);
[JScript]
public function Insert(
   index : int,
   value : Char[],
   startIndex : int,
   charCount : int
) : StringBuilder;

Parameters

index
The position at which to insert.
value
The character array from which to get the characters to be inserted.
startIndex
The starting index within value.
charCount
The number of characters to insert from value.

Return Value

A reference to the current StringBuilder with value[startIndex..charCount) inserted at index.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException if either index is greater than the length of the current StringBuilder, or index is less than zero.

Remarks

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

If value equals Empty, the StringBuilder is not changed. Inserts the empty string if value is a null reference (in Visual Basic Nothing).

See Also

StringBuilder Class | StringBuilder Members | System.Text Namespace | StringBuilder.Insert Overload List