欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

python判断一个字符串是否包含另外一个字符串

shiping1 的头像
 
 
my_string = "abcdef"
 
if "abc" in my_string:
    has_abc = True
 
if has_abc == True:
    print "String contains string."
#该代码片段来自于: http://www.sharejs.com/codes/python/2367

来自 http://www.sharejs.com/codes/python/2367
普通分类: