我有一个字符串列表,我想删除该列表中每一行中“ \ n”之后的所有文本(包括“ \ n”)。我该怎么办?
我尝试使用分区功能,但不适用于列表...
my_list =["Today is a good day.\nLet's go outside","I have a cat to feed.\nI need go home now."]
预期结果:
my_list =['Today is a good day.','I have a cat to feed.']
感谢所有帮助
答案 0 :(得分:2)
列出您的清单:
RundeckClient