How to replace unicode characters in string with something else python?

后端 未结 4 663
暗喜
暗喜 2020-11-29 02:51

I have a string that I got from reading a HTML webpage with bullets that have a symbol like \"•\" because of the bulleted list. Note that the text is an HTML source from a w

4条回答
  •  再見小時候
    2020-11-29 03:34

    Funny the answer is hidden in among the answers.

    str.replace("•", "something") 
    

    would work if you use the right semantics.

    str.replace(u"\u2022","something") 
    

    works wonders ;) , thnx to RParadox for the hint.

提交回复
热议问题