What\'s the best way of getting just the difference from two multiline strings?
a = \'testing this is working \\n testing this is working 1 \\n\'
b = \'testi
This is basically @Godron629's answer, but since I can't comment, I'm posting it here with a slight modification: changing difference
for symmetric_difference
so that the order of the sets doesn't matter.
a = 'testing this is working \n testing this is working 1 \n'
b = 'testing this is working \n testing this is working 1 \n testing this is working 2'
splitA = set(a.split("\n"))
splitB = set(b.split("\n"))
diff = splitB.symmetric_difference(splitA)
diff = ", ".join(diff) # ' testing this is working 2, some more things...'