Returns a new string with a specified value inserted at a specified position in this string.
[Visual Basic] Public Function Insert( _ ByVal startIndex As Integer, _ ByVal value As String _ ) As String [C#] public string Insert( int startIndex, string value ); [C++] public: String* Insert( int startIndex, String* value ); [JScript] public function Insert( startIndex : int, value : String ) : String;
A new string with the string inserted at position of this string.
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | If the beginning position is not within the range of this instance. |
ArgumentOutOfRangeException | If the string is null. |
The Insert method makes a new string by inserting a specified string (value) at a specified location (startIndex) in this string.