Method SplitFlags
SplitFlags<T>(T, SplitFlagsOptions)
Splits the value into the defined flags that make up the value, plus any remainder (if ExcludeRemainder is not set).
Declaration
public static IReadOnlyList<T> SplitFlags<T>(this T value, SplitFlagsOptions options = SplitFlagsOptions.None) where T : unmanaged, Enum
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The value to split. |
| SplitFlagsOptions | options | The options to use for the splitting operation. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
If ExcludeRemainder is not set and there is a remainder that cannot be represented by any defined flags then its value
is appended to the end of the resulting list. You can check if the last element is a remainder by calling IsDefined<T>(T)
on it. You can also exclude the remainder or throw an exception if there is a remainder via the options parameter.