Encodes a range of characters from a character array into a byte array.
[Visual Basic] Overloads Overridable Public Function GetBytes( _ ByVal chars() As Char, _ ByVal index As Integer, _ ByVal count As Integer _ ) As Byte () [C#] public virtual byte[] GetBytes( char[] chars, int index, int count ); [C++] public: virtual unsigned char* GetBytes( __wchar_t* chars[], int index, int count ) []; [JScript] public function GetBytes( chars : Char[], index : int, count : int ) : Byte[];
An array of type Byte containing the encoded representation of a range of characters in the specified character array.
Exception Type | Condition |
---|---|
ArgumentException | The chars argument is null.The index and count arguments do not denote a valid range in the character array. |
Encoding Class | Encoding Members | System.Text Namespace | Encoding.GetBytes Overload List | GetByteCount | GetMaxByteCount | GetDecoder | GetEncoder