a need to remove some duplicates.
A list contains elements, which are strings contains strings separated by “;”. The strings in each string could be duplicated. Such as:
"15-105;ZH0311;TZZGJJ; ZH0311; ZH0311;DOC",
There are 3 “ZH0311” in the string (the number of appearing is not fixed). I need to eliminate the duplicates and refine the string to (sequence of strings inside doesn't matter):
"15-105;TZZGJJ; ZH0311;DOC",
I am thinking to split the strings by ";" and link them together. How can I do the same for the whole list?
a_list = [
"15~105;~ PO185-400CT;NGG;DOC",
"15~105;-1;NGG;DOC",
"15~105; 15~105; NGG;-10;NGG;DOC",
"15~55;J205~J208;POI;DOC",
"15-105;15-105;ZH0305~;WER /;TZZGJJ;DOC",
"15-105;ZH0311;TZZGJJ; ZH0311; ZH0311;DOC",
"15-115;15-115; PL026~ PL028; Dry;PTT"]
please note the strings contains Non-ASCII characters.
By the way question: Is it a difference that it’s not strings in the list, but lists in the list and elements in each nested list are duplicated?