微信扫一扫
str = '正文————评论' head, sep, tail = str.partition('————') print(head)
字符被切分成三个部分,输出头部,就会输出:
正文
相关推荐