Craig,
As Drew suggested, create a third AL that is your result, for each item in
the first, if it is not in the second add it to your result.
Something like:
Dim groups As New ArrayList
Dim assigned As New ArrayList
Dim result As New ArrayList
groups.Add("one")
groups.Add("two")
groups.Add("three")
assigned.Add("two")
For Each group As Object In groups
If not assigned.Contains(group) Then
result.Add group
End If
Next
Instead of an ArrayList however I would use a GroupCollection object that
contains individual Group objects, where GroupCollection inherits from
either DictionaryBase or CollectionBase depending on whether it is a "keyed"
collection or not. The above code would be a function of the GroupCollection
object.
Public Class GroupCollection
Inherits CollectionBase
...
Public Function GetDifference(...) ...
For Each group As Object In InnerList
Hope this helps
Jay
"Craig Buchanan" <so*****@microsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I have two arraylists, one with a list of groups and one with a list of
groups assigned to a user. I would like to subtract the second AL from
the first AL to get an AL of groups to which the user *isn't* assigned. Is
there an easy way to do this?
Thanks,
Craig