public class StringTest {
public static void main(String args[]) {
String s = "hello, this is a test this is a test this is a this is test";
String p = "test";
for(int i = 0; i < s.length(); i ++) {
int at = s.indexOf(p, i);
if(at < 0) {
break;
}
System.out.println(p + "@" + at);
i = at;
}
}
}