This question has been bothering me all day.
if I'm trying to pull out all strings that are in a txt file
and all start with "abcde"
is there anyway to find them, and copy the strings??
assuming the txt file contains lots of text

Look up the methods of the string class. There's a lot you can do with it.

I'm think of using getline()
by using pos=str.find(abcde)
I can locate the str and make a substr till the end of line or specified length
is that gana work? or any other faster way?

one more question
by using my method, can I stop the substr at certain char such as whitespace?

Sounds like your idea will work well. Try it and see.

I don't know about stopping at whitespace, but you can certainly find whitespace after your substring is found.

thanks to WaltP's help
I'm able to figure out a way to solve my problem
here is the structure of my code
hope it will help others

using namespace std;

int main()
string imgURL, line;
size_t pos, found;
ifstream myfile; ("1.txt");
ofstream writefile; ("2.txt");
    getline(myfile, line);
    found=line.find("some text");
      pos=line.find("some text");
      //use method like erase or specify a range to copy the string you want

return 0;