regex - Replace all occurences of one word in string in python -
I have this string:
"tag: tie, tag: ball, tag : Honey " I want to replace the" tag "with" "so that I have:
tie, ball, honey I think I should use re.sub but I can not write proper regular expressions.
How do I get it?
Pretty simple:
s = "tag: tie, tag : Ball, tag: honey "print s.replace (", "")
Comments
Post a Comment