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)
sep = '...'
stripped = text.split(sep, 1)[0]
sep = '...'
stripped = text.split(sep, 1)[0]
text = input()
sep = '...'
stripped = text.split(sep, 1)[0]
print(stripped)
import re
inputt = input()
# write the characters you want to remove in square brackets
line = re.sub('[ie]', '', inputt)
print(line)
a_string = "addbdcd"
a_string = a_string.replace("d", "")
print(a_string)
mystring = "123⋯567"
mystring[ 0 : mystring.index("⋯")]
>> '123'