System.BitConverter.ToString Method

Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation.

Syntax

public static string ToString (byte[] value)

Parameters

value
An array of bytes.

Returns

A string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in value; for example, "7F-2C-4A-00".

Remarks

All the elements of value are converted. The order of hexadecimal strings returned by the BitConverter.ToString(Byte[]) method depends on whether the computer architecture is little-endian or big-endian.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0