Removing backslashes from a string in Python

前端 未结 4 2031
挽巷
挽巷 2020-12-11 14:33

How do I remove all the backslashes from a string in Python?

This is not working for me:

result = result.replace(\"\\\\\", result)

4条回答
  •  不思量自难忘°
    2020-12-11 15:10

    If you are interested in seeing the component words that are being separated by the '\' character, use:

    result.replace('\\', ' ')
    

提交回复
热议问题