首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

有没有办法去除字符串两边的引号?解决方法

2012-03-15 
有没有办法去除字符串两边的引号?Python codexabcdefxabcdef现在需要变成xabcdef[解决办法]试试这样

有没有办法去除字符串两边的引号?

Python code
x='abcdef'x'abcdef'现在需要变成xabcdef


[解决办法]
试试这样看
Python code
cmd = "hangshu(x=%s,y=%s)"%(abc,efg)exec(cmd)
[解决办法]
import re
x='abcdef'
data=re.compile('......')
for m in data.finditer(x):
print(m.group())
结果
abcdef

热点排行