BitConverterToString Method (Byte, Int32, Int32) |
Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static string ToString(
byte[] value,
int startIndex,
int length
)
Parameters
- value
- Type: SystemByte
An array of bytes. - startIndex
- Type: SystemInt32
The starting position within value. - length
- Type: SystemInt32
The number of array elements in value to convert.
Return Value
Type:
StringA string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in a subarray of
value; for example, "7F-2C-4A-00".
Exceptions Exception | Condition |
---|
ArgumentNullException | value is null. |
ArgumentOutOfRangeException | startIndex or length is less than zero.-or-startIndex is greater than zero and is greater than or equal to the length of value. |
ArgumentException | The combination of startIndex and length does not specify a position within value; that is, the startIndex parameter is greater than the length of value minus the length parameter. |
See Also