Skip to content

ByteExtensions.ToBinaryString Method ​

Definition ​

Converts a byte to its binary string representation, for example, "0b01011010".

c#
public static string ToBinaryString(this Byte value);

View source

Parameters ​

NameTypeDescription
valueByteThe byte value.

Returns ​

String

A 10-character string prefixed with "0b" followed by 8 binary digits.