I have array A and Array B , I want to get as result A\B (to get only the strings that in A but not in B).
Of course I can d开发者_如何学JAVAo two for
loops and do it , but is there some more nice way to do so ?
Thanks for help , i use .net3.5
You can use LINQ:
var difference = A.Except(B);
This uses a HashSet and will be substantially faster than nested for
loops for large sets.
精彩评论