//!!!could the begin and last be removed and just use long.MinValue, etc???? public static RangeCollection Except(this RangeCollection rangeCollectionMain, RangeCollection rangeCollectionToSubtract, long fullRangeBegin, long fullRangeLast) { if (rangeCollectionToSubtract.IsEmpty) { return(rangeCollectionMain); } RangeCollection rangeCollection = rangeCollectionMain.Complement(fullRangeBegin, fullRangeLast); rangeCollection.AddRangeCollection(rangeCollectionToSubtract); RangeCollection result = rangeCollection.Complement(fullRangeBegin, fullRangeLast); return(result); }