outer: for (int i = 0; i < w.length(); i++) { for (int j = 0; i < m.length (); j++) { if (m[j] != w[i+j]) continue outer; } return i; }