find substring inside a vector

Hello all

I am trying to find a substring in a string contained in a vector (each element of this vector is whole one line read from file). The code below works fine but is too slow. Could anyone please suggest any other way of doing it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
for( vector<string>::const_iterator it403 = vect00403.begin(); it403 != vect00403.end(); ++it403 )	// contains substrings
{
	for( vector<string>::const_iterator itr = read_413_line.begin(); itr != read_413_line.end(); ++itr )	// contains lines read from file
	{
		substr = *itr;
		
     		if( substr.find(*it403) != string::npos )
       		{            			
            		common.push_back(*itr);
            			
            		break;
        	}
    	}
}


Thanks
Are the substrings whole words or is there some common way to tokenize the substrings?
Topic archived. No new replies allowed.