I want to strip double quotes from:
string = \'\"\" \" \" \"\"\\\\1\" \" \"\" \"\"\'
to obtain:
string = \'\" \" \" \"\"\\\
Starting in Python 3.9, you can use removeprefix and removesuffix:
Python 3.9
'"" " " ""\\1" " "" ""'.removeprefix('"').removesuffix('"') # '" " " ""\\1" " "" "'