📅  最后修改于: 2022-03-11 14:58:28.378000             🧑  作者: Mango
a = "hellohellohello"
def splitstring(string):
for number in range(1, len(string)):
if string[:number] == string[number:number+number]:
return string[:number]
#in case there is no repetition
return string
splitstring(a)