469,296 Members | 2,147 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,296 developers. It's quick & easy.

String manipulation(NEWBIE!)

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?

Thanks!!
Mar 26 '08 #1
1 1029
jlm699
314 100+
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.

Similar topics

16 posts views Thread by Krakatioison | last post: by
5 posts views Thread by Stu Cazzo | last post: by
9 posts views Thread by John F Dutcher | last post: by
9 posts views Thread by Derek Hart | last post: by
10 posts views Thread by Angus Leeming | last post: by
2 posts views Thread by Andrew | last post: by
2 posts views Thread by s | last post: by
11 posts views Thread by Christopher Benson-Manica | last post: by
4 posts views Thread by blrmaani | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.