Skip to content

ByteExtensions.SetBit Method ​

Definition ​

Returns a new byte with the bit at the specified index set.

c#
public static Byte SetBit(this Byte value, int index);

View source

Parameters ​

NameTypeDescription
valueByteThe byte value.
indexInt32The zero-based bit index to set.

Returns ​

Byte

A new byte with the specified bit set.