I'm wondering if there is a quick/clean way to get the symmetric difference between two sets ?
I have:
Set<String> s1 = new HashSet<String>();
s1.add("a");
s1.add("b");
s1.add("c");
Set<String> s2 = new HashSet<String>();
s2.add("b");
I need something like:
Set<String> diff = Something.diff(s1, s2);
// diff would contain ["a", "c"]
Just to clarify I need the symmetric difference.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…