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__"
Asked
Active
Viewed 475 times
-6
-
1When 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 Answers
0
If text
is our string, then
text = text.replace("\"", "")
should do the trick (it replaces the "
by nothing, effectively deleting them).

Desktop Firework
- 110
- 7