How to split a complex sentence string, keeping the delimiter, but not also placing the demiiter where it shouldn't be

前端 未结 0 1819
礼貌的吻别
礼貌的吻别 2021-02-20 06:02

I came across this snippet on Grepper:

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


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题