xxxxxxxxxx
Use str. split() to remove everything after a character in a string
a_string = "ab-cd"
split_string = a_string. split("-", 1) Split into "ab" and "cd"
substring = split_string[0]
print(substring)
xxxxxxxxxx
mystring = "123⋯567"
mystring[ 0 : mystring.index("⋯")]
>> '123'