Initializes an instance of the string class from the characters in a subarray.
[Visual Basic] Overloads Public Sub New( _ ByVal value() As Char, _ ByVal startIndex As Integer, _ ByVal length As Integer _ ) [C#] public String( char[] value, int startIndex, int length ); [C++] public: String( __wchar_t* value[], int startIndex, int length ); [JScript] public function String( value : Char[], startIndex : int, length : int );
Exception Type | Condition |
---|---|
ArgumentNullException | If value is null. |
ArgumentOutOfRangeException | If the starting position or if the combined starting position and length of the string are not valid indices of the array. |
This constructor initializes an new string that is created from a subarray. The new String will contain the number of characters (length) from the array (value) that begins at the position indicated (startIndex).
An exception will be thrown if startIndex or (startIndex + length -1) are not valid indices.
String Class | String Members | System Namespace | String Constructor Overload List | Char | Int32