I\'m sure there must be a much better way of doing this. I\'m trying to do a count operation on a Flags enum. Before I was itterating over all the possible values and counting t
A very concise way to do it using BitArray and LINQ:
BitArray
public static int Count(Skills skillsToCount) { return new BitArray(new[] {(int)skillsToCount}).OfType().Count(x => x); }