By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,767 Members | 2,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,767 IT Pros & Developers. It's quick & easy.

String manipulation(NEWBIE!)

P: 1
Hey Guys,

Sorry if this is silly question but i am new to all of this!

Basically i have a file that has some content in it that i want to get out.

i want to find say an occurence of the string "blah".

then i want to find the next occurence of the string "blah2" after that.

and then i want to use the information between the 2 strings i have found??

Does anybody have any information i could use on something like this?

Mar 26 '08 #1
Share this Question
Share on Google+
1 Reply

P: 314
I think your best bet would be to read() the file's contents into a string variable and then search through that using the find() method, which returns an index.

From that point it's a simple matter of using slicing [x : y] on the string.

Hope that helps...
Mar 26 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.