CString str = L"select * from somewhere where x = 1"; CString to_find = L"where"; int i =0; while ( i < str.GetLength() ) { i = str.Find(to_find, i); if ( i == -1 ) break; if ( (i == 0 || !isalpha(str[i-1])) && (i == str.GetLength()-to...