#!/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."
判断字符串中含有某字符串
最新推荐文章于 2024-04-25 11:14:20 发布