I try to search like this :

string array[20000]; // creates array to hold names

char strength[7];

for(int i = 0;i<85; i++) { if((array[2][i]=='5') && (array[2][i+1] == '0') && (array[2][i+2] ==':') && (array[2][i+3] =='6') && (array[2][i+4] == '7') && (array[2][i+5] ==':') && (array[2][i+6] =='f') && (array[2][i+7] =='0') && (array[2][i+8] ==':') && (array[2][i+9] =='e') && (array[2][i+10] =='7') && (array[2][i+11] ==':') && (array[2][i+12] =='d') && (array[2][i+13] =='9') && (array[2][i+14] ==':') && (array[2][i+15] =='1') && (array[2][i+16] =='c' )) { for(int j = 0; j<6;j++) strength[j]=array[2][i+j+17]; } } cout<<strength<<endl; }

This searching method seems to work. But I have a lot of substrings to search. Is there a more efficient way to do this?

Thanks in advance!