How can I strip first and last double quotes?

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

I want to strip double quotes from:

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

to obtain:

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


        
13条回答
  •  旧时难觅i
    2020-12-02 10:56

    Remove a determinated string from start and end from a string.

    s = '""Hello World""'
    s.strip('""')
    
    > 'Hello World'
    

提交回复
热议问题