How to find if a string contains another string

Discussion in 'Python' started by Borse, Ganesh, Oct 30, 2007.

  1. 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
    ==============================================================================
     
    Borse, Ganesh, Oct 30, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Dyer
    Replies:
    5
    Views:
    693
  2. Replies:
    17
    Views:
    864
    Hiran Chaudhuri
    Dec 6, 2005
  3. Borse, Ganesh
    Replies:
    2
    Views:
    1,668
    Dennis Lee Bieber
    Oct 30, 2007
  4. tomaszewski.p
    Replies:
    4
    Views:
    822
    Tom Anderson
    Sep 12, 2008
  5. Knute Johnson
    Replies:
    0
    Views:
    428
    Knute Johnson
    Sep 11, 2008
Loading...

Share This Page