Hi all,
i am currently working on a thesis project and in it, i have a part regarding identifications of degrees of individuals, grades and so on. i am stuck in a problem regarding duplicates in strings.
I have a string that contains numerous words and digits separated by a comma. I would like to remove all duplicates inside these strings that are separated by a comma. For example,
100, 98, 89, 98, 100, 0, undergraduate, undergraduate, graduate, post graduate, 19-25, 25-29, ...... would become
100, 98, 89, 0, undergraduate, graduate, post graduate, 19-25, 25-29, ..
Notice that the 25 is not counted as a duplicate as it is connected to either 19 or 29 by a "-" in this case.
I would prefer to use regular expressions if it is possible. i would appreciate any help in this matter!
Thank you so much in advance!
i am currently working on a thesis project and in it, i have a part regarding identifications of degrees of individuals, grades and so on. i am stuck in a problem regarding duplicates in strings.
I have a string that contains numerous words and digits separated by a comma. I would like to remove all duplicates inside these strings that are separated by a comma. For example,
100, 98, 89, 98, 100, 0, undergraduate, undergraduate, graduate, post graduate, 19-25, 25-29, ...... would become
100, 98, 89, 0, undergraduate, graduate, post graduate, 19-25, 25-29, ..
Notice that the 25 is not counted as a duplicate as it is connected to either 19 or 29 by a "-" in this case.
I would prefer to use regular expressions if it is possible. i would appreciate any help in this matter!
Thank you so much in advance!
Comment