python判断某个字符串中是否包含某个子字符串,方法:if ’str1‘ in str

使用in方法web 实例:svg str1='hello china!' if 'china' in str1: print('yes') else: print('no') 运行结果:.net yes 参考:连接code
相关文章
相关标签/搜索