[英]python substring not being printed
我无法想象这部分代码有什么问题
if value.find("\\") > -1:
newstr = int(value.find("\\"))
print newstr
print value
print value[newstr:7]
正在正确打印newstr
以及value
但value[newstr:7]
显示为空白。
有任何想法吗?
value[newstr:7]
将从位置newstr
到7
。
也许你的意思是value[newstr:newstr + 7]
?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.