Python Learning

Sunday, 27 December 2020

Does Python have a string 'contains' substring method?

 You can use the in operator:

if "blah" not in somestring: 
    continue


from : https://stackoverflow.com/questions/3437059/does-python-have-a-string-contains-substring-method

Posted by Ryoko at 02:14
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Ryoko
View my complete profile

Blog Archive

  • ►  2022 (25)
    • ►  December (1)
    • ►  November (1)
    • ►  September (7)
    • ►  July (1)
    • ►  June (1)
    • ►  April (2)
    • ►  March (3)
    • ►  February (7)
    • ►  January (2)
  • ►  2021 (35)
    • ►  November (2)
    • ►  October (3)
    • ►  September (4)
    • ►  August (2)
    • ►  July (2)
    • ►  June (3)
    • ►  May (8)
    • ►  April (1)
    • ►  March (5)
    • ►  February (3)
    • ►  January (2)
  • ▼  2020 (106)
    • ▼  December (9)
      • 深入理解asyncio(三)
      • 深入理解asyncio(二)
      • 深入理解asyncio(一)
      • how do you filter pandas dataframes by multiple co...
      • How do I concatenate two lists in Python?
      • How do I list all files of a directory?
      • Does Python have a string 'contains' substring met...
      • Pass **kwargs if not none
      • Proper way to use **kwargs in Python
    • ►  November (1)
    • ►  October (3)
    • ►  September (5)
    • ►  August (6)
    • ►  July (9)
    • ►  June (2)
    • ►  May (6)
    • ►  April (27)
    • ►  March (4)
    • ►  February (25)
    • ►  January (9)
Simple theme. Powered by Blogger.