472,979 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to find if a string contains another string


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

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

bigstring="python anaconda boa cobra"

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,

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

================================================== ============================

Oct 30 '07 #1
0 1241

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Saeed Amrollahi | last post by:
Dear All C++ Programmers Hello I am Saeed Amrollahi. I am a software engineer in Tehran Sewerage Company. I try to use std::map and map::find member function. I use Visual Studio .NET. my...
by: J. B. Moreno | last post by:
What's the best (i.e. fastest) way to find out if an array contains a given value? Other than looping, the only way I know to do it is to use an associative array/hash instead.... Is there a...
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
by: KL | last post by:
Hello again, I am still working on this homework assignment and have hit a wall. I have a list that I want to fill with all occurences of img tags from a big string of html code. So I have a...
by: Robert Bravery | last post by:
Hi all, How can I use the contains method to find a partial value in a list eg if I have a list that contains "I love my Dog" "I hate the mouse" and I want to know if the list contains the...
by: Lighter | last post by:
I find a BIG bug of VS 2005 about string class! #include <iostream> #include <string> using namespace std; string GetStr() { return string("Hello");
by: nishit.gupta | last post by:
Is their any fuction available in C++ that can determine that a string contains a numeric value. The value cabn be in hex, int, float. i.e. "1256" , "123.566" , "0xffff" Thnx
by: Andrus | last post by:
I need to create object cache in memory. Each object id can be composed from several string, integer and decimal type values. ContainsKey does not find existing key in this case. How to...
by: Arthur Dent | last post by:
Hello all, I am trying to figure out how to do something in LINQ, IF I can even do it in LINQ. Online samples and such for LINQ is still a bit on the sketchy side. Here is what I want to...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.