How to find if a string contains another string

B

Borse, Ganesh

Hi,

Am new to python.
May someone please help me know this?

How can we check whether one big string contains another small string?

E.g.
bigstring="python anaconda boa cobra"
smallone="boa"

If 0 == contains(bigstring,smallone):
print "Yes, boa is snake.."

Is there any function like "contains" or "exists" in python?
What are different alternatives we have?

Please help.

Thanks and Regards,
Ganesh

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top