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]
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)
mystring = "123⋯567"
mystring[ 0 : mystring.index("⋯")]
>> '123'
myString = myString.replace(/D/g,'');