How can I strip first and last double quotes?

后端 未结 13 1239
抹茶落季
抹茶落季 2020-12-02 10:14

I want to strip double quotes from:

string = \'\"\" \" \" \"\"\\\\1\" \" \"\" \"\"\'

to obtain:

string = \'\" \" \" \"\"\\\         


        
相关标签:
13条回答
  • 2020-12-02 11:09

    If the quotes you want to strip are always going to be "first and last" as you said, then you could simply use:

    string = string[1:-1]

    0 讨论(0)
提交回复
热议问题