2017-07-25 148 views

回答

2

嘗試:

variable.replace("\"","").strip() 

replace用什麼代替了雙引號(刪除它)和strip()去掉尾隨和前導空格

0

你可以試試這個:

s = ' "value" ' 

s = s[2:-2] 

print(s) 

輸出:

value 
相關問題