Converts the given byte array to pure hex digits. { 0, 255 } becomes 00FF

Namespace: System.Extensions
Assembly: System.Extensions (in System.Extensions.dll) Version: 0.0.0.5 (0.0.0.5)

Syntax

C#
public static string ToHexString(
	this byte[] array
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function ToHexString ( 
	array As Byte()
) As String
Visual C++
public:
[ExtensionAttribute]
static String^ ToHexString(
	array<unsigned char>^ array
)
F#
static member ToHexString : 
        array : byte[] -> string 

Parameters

array
Type: array<System..::..Byte>[]()[][]
The byte array to convert to hex.

Return Value

Type: String
The hex string representation of the byte array.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also