Python implementation confirms that the string contains an instance of the specified string

Source: Internet
Author: User
This article mainly introduces the implementation of Python to confirm whether the string contains the instance of the specified string, has a certain reference value, now share to everyone, the need for friends can refer to

Sometimes we need to find a string or a sentence to confirm that we have the string information we need.

To cite an example,

A segment variable is: a= "My name is Clay, and you can get My name"

A = "My name is Clay, and you can get the My name" MyName = "Clay" If MyName in A://do what the want to do  

And we need to find out if a contains the clay field.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.