Verify two List type and String type Variables for duplicates

I have a field which stores multiple buildings as a single string separated with ‘;’.
When I try to add more buildings to the same row, I would like to compare the previously added building and new ones that i selected from a multiselect dropdown.

If a building name exists in the row already, it should throw an error, however, it is not comparing the data correctly between two variables where i am storing this data. Please suggest how do i achieve this.