File size: 599 Bytes
3caa485 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import unicodedata
def _remove_non_string_characters(string):
symbols_to_remove = ["Δ"]
return "".join(
char
for char in string
if unicodedata.category(char)[0] in {"L", "N", "P", "Z"}
and char not in symbols_to_remove
)
def compare_strings_ignore_non_string(string1, string2):
string1 = _remove_non_string_characters(string1)
string2 = _remove_non_string_characters(string2)
if string1 != string2 and string1[0:20] == string2[0:20]:
print(f"String1: {string1}")
print(f"String2: {string2}")
return string1 == string2
|