Skip to content

Commit 0a4637f

Browse files
Aman MishraAman Mishra
authored andcommitted
Fixed multicharacter seperator bug
1 parent 144ef9c commit 0a4637f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

strings/split.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def split(string: str, separator: str = " ") -> list:
2020
"""
2121

2222
split_words = []
23+
if(len(separator)>1):
24+
raise ValueError("Separator must be a single character")
2325

2426
last_index = 0
2527
for index, char in enumerate(string):

0 commit comments

Comments
 (0)