Skip to content

Int32Extensions.SetBits Method

Definition

Sets a range of bits in an int to the specified value.

public static int SetBits(this int value, int bits, int startInclusive, int endInclusive);

View source

Parameters

Name Type Description
value Int32
bits Int32 The value to set in the bit range.
startInclusive Int32 The zero-based start bit index, inclusive.
endInclusive Int32 The zero-based end bit index, inclusive.

Returns

Int32

A new int with the specified bit range replaced by bits.