471,350 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

How to find if a string contains another string

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/e..._email_ib.html
================================================== ============================

Oct 30 '07 #1
0 1179

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Saeed Amrollahi | last post: by
8 posts views Thread by J. B. Moreno | last post: by
4 posts views Thread by KL | last post: by
1 post views Thread by Robert Bravery | last post: by
13 posts views Thread by nishit.gupta | last post: by
6 posts views Thread by Andrus | last post: by
4 posts views Thread by Arthur Dent | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.