How do I get rid of all the apostrophes in this string:
text = "‘https://google.com/’"
I've tried this but it just returns the string with the first apostrophe gone and the end one stays and messes up my get request...
text = "‘https://google.com/’"
if "'" in text:
text = text.replace("'", '')
By the way, google.com is supposed to be replaced with a t.co link but stack doesn't allow it
You list all your apostrophes in a regular expression and remove them:
import re
text = "‘https://google.com/’"
text = re.sub(r'[’‘]', '', text)
This will remove any ’
and ‘
in the text. If you want to remove additional types of characters, just modify the regexp to include them.
They look the same, but not exactly the same characters. The first one is \xe2\x80\x98
(LEFT SINGLE QUOTATION MARK
) while the second one is \xe2\x80\x99
(RIGHT SINGLE QUOTATION MARK
).
How to prevent a token created with OAuth 2.0 from expiring?
I am currently parsing an XML and from that, fill a dataframeSuppose we have this toy XML:
This code successfully takes the contents of the form and saves it to an ordered list, 2 more functions do the same thing but instead create a timestampI'm trying to take every li element that gets generated and save it to localStorage when you push the save button...
I'm using some "legacy" code in my React appWebpack throws countless "no-restricted-globals" and "no-undef" errors, and doesn't allow me to compile
in a wtforms, I would like my SelectField to fill up with its selected value a StringFieldI use flask, bootstrap, and python 3