Pyton 字符串包含及判断处理及去除空格

第一种方法:in string = 'helloworld' if 'world' in string:   print 'Exist' else:   print 'Not exist' 第二种方法:find string = 'helloworld' if string.find(’world‘) == 5: #5的意思是world字符从那个序开始,因为w位于第六个,及序为5,所以判断5   
相关文章
相关标签/搜索