Python split() without removing the delimiter [duplicate]

d = ">"
for line in all_lines:
    s =  [e+d for e in line.split(d) if e]

Leave a Comment