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, String, Int32)

Inserts multiple copies of a string into the current StringBuilder at the specified position.

[Visual Basic]
Overloads Public Function Insert( _
   ByVal index As Integer, _
   ByVal value As String, _
   ByVal count As Integer _
) As StringBuilder
[C#]
public StringBuilder Insert(
   int index,
   string value,
   int count
);
[C++]
public: StringBuilder* Insert(
   int index,
   String* value,
   int count
);
[JScript]
public function Insert(
   index : int,
   value : String,
   count : int
) : StringBuilder;

Parameters

index
the position at which to insert.
value
the string to be inserted.
count
the number of times the string is to be inserted.

Return Value

A reference to the current StringBuilder with value inserted count times starting 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 | String