Skip to content

Commit 64cbaad

Browse files
Update split.py
1 parent 393a3c7 commit 64cbaad

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

strings/split.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ def split(string: str, separator: str = " ") -> list:
2626
if char == separator:
2727
split_words.append(string[last_index:index])
2828
last_index = index + 1
29-
elif index + 1 == len(string):
29+
if index + 1 == len(string):
3030
split_words.append(string[last_index : index + 1])
31-
32-
if string and string[-1] == separator:
33-
split_words.append("")
34-
3531
return split_words
3632

3733

0 commit comments

Comments
 (0)