小编Wal*_*apa的帖子

如何删除第一个和最后一个双引号

我想从中删除双引号

string = '"" " " ""\\1" " "" ""'
Run Code Online (Sandbox Code Playgroud)

成为

string = '" " " ""\\1" " "" "'
Run Code Online (Sandbox Code Playgroud)

我试图用rstrip,lstripstrip('[^\"]|[\"$]')但没有奏效.

我怎样才能做到这一点?感谢你们对我的帮助.

python string strip

94
推荐指数
8
解决办法
18万
查看次数

标签 统计

python ×1

string ×1

strip ×1