Int32Extensions.SetBits Method ​
Definition ​
Sets a range of bits in an int to the specified value.
c#
public static int SetBits(this int value, int bits, int startInclusive, int endInclusive);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 ​
A new int with the specified bit range replaced by bits.