gpt4 book ai didi

python - 检查字符串是否包含子字符串或其中的一部分

转载 作者:太空宇宙 更新时间:2023-11-04 10:02:09 25 4
gpt4 key购买 nike

<分区>

我想检查一个字符串是否包含子字符串或该子字符串的一部分,例如:

string = "Hello 13 World"
substring = "01234567890"
print has_part_of_substring(string, substring) # True: "1" and "3" contains on the string

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com