I\'m looking for the way of comparing two strings and being able to get back, as separate strings:
Use set:
s = set("123 ABC") t = set("135 AZ") intersect = s & t # or s.intersection(t) exclusion = s ^ t # or s.symmetric_difference(t) a_minus_b = s - t # or s.difference(t) b_minus_a = t - s # or t.difference(s)