MSDN documentation of both methods looks very similar. Also the example cited beneath the remarks for IsSupersetOf
is not very helpful either.
Can someone please explain to me the difference using simple language?
You can think of it like the difference between >
and >=
. IsSuperSetOf is doing something like >=
, so your set could have exactly the same elements that are in the set you're comparing to. By contrast, a proper super set is kind of like >
and has extra elements that the second set doesn't have.
For example, a set is a superset of itself, but it's not a proper superset of itself.
A proper subset cannot equal the set.
{1,2,3} is a subset of {1,2,3}, but not a proper subset
{1,2} is a proper subset (and subset) of {1,2,3}
http://www.mathsisfun.com/sets/sets-introduction.html
A superset of set A
is a set that contains all of the elements of set A
A proper superset of A
is a set that contains all of the elements of A
but is not equal to A
.
So if A
= {1,2,3}
, then {1,2,3}
is a superset of A
but not a proper superset, while {1,2,3,4}
is a proper superset.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With