ByteArrayExtensionsToHexValuesString(Byte, String) Method

Converts the byte array to string of hexadecimal values.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public static string ToHexValuesString(
	this byte[] bytes,
	string? separator = null
)

Parameters

bytes  Byte
The byte array to convert.
separator  String  (Optional)
The separator to use between the hex numbers. If or empty, the hex stream will be continuous. This parameter is optional.
Default value: .

Return Value

String
The string representation, in hex, of the contents of bytes.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Byte. 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).

Exceptions

ArgumentNullExceptionbytes is
ArgumentExceptionseparator contains hex digits

See Also