```
public class Solution {
public boolean repeatedSubstringPattern(String s) {
for(int i = 0; i < s.length() / 2; i++) {
if(s.length() % (i + 1) != 0) continue;
int j = i + 1;
while(j < s.length()) {
if(s.charAt(j) == s.charAt(j % (i + 1))) {
j++;
continue;
} else {
break;
}
}
if(j >= s.length()) return true;
}
return false;
}
}
```