我有一个字符串:
s = "grocery store not liquor shop not restaurant, sell milk"
,我想删除"not“之后的第一个字。如何在python中实现它?我希望得到如下结果:
"grocery store shop, sell milk"
或
"grocery store, sell milk"
如果也可以删除'not‘和任何标点符号/字符串结尾之间的所有单词。
转载请注明出处:http://www.tochigihk.com/article/20230526/1597512.html