-6

In python, I want to check whether a string contains " and remove this part. For example: string like: "\"__PRO__\"", I want to check it contains " and get "__PRO__"

jenny
  • 41
  • 1
  • 5
  • 1
    When dealing with escaping you need to be ***really*** careful and specific what you actually have and what you want to achieve, e.g. write proper `code blocks` using `\`` around it. – luk2302 Apr 20 '22 at 07:47
  • I suggestion you to do `find` and `slice` to practice the syntax – cards Apr 20 '22 at 08:04

2 Answers2

0
s = '""PRO""'
s = s.replace('"','')
0

If text is our string, then

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

should do the trick (it replaces the " by nothing, effectively deleting them).