Equivalent string.find method for a list of strings

J

jeremit0

I have read a text file using the command

lines = myfile.readlines()

and now I want to seach those lines for a particular string. I was
hoping there was a way to "find" that string in a similar way as
searching simply a simple string. I want to do something like

lines.find.('my particular string')

Is there a module that already exists that allows me to do this or will
I have to created my own method?
Thanks,
Jeremy
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top