判断字符串中含有某字符串

来源:互联网 发布:node v0.12.2 x64.msi 编辑:程序博客网 时间:2024/05/22 14:42
#!/usr/bin/env python## [SNIPPET_NAME: String contains string test]# [SNIPPET_CATEGORIES: Python Core]# [SNIPPET_DESCRIPTION: Test if a string contains another string]# [SNIPPET_AUTHOR: Jono Bacon <jono@ubuntu.com>]# [SNIPPET_LICENSE: GPL]my_string = "abcdef"if "abc" in my_string:    <pre name="code" class="python">print "String contains string."

0 0
原创粉丝点击