✔ 最佳答案
Use indexOf(String str, int fromIndex) method of the String class. It returns the index of the first occurrence of the substring within the searched string, starting from the specified index.
i = myString.indexOf(substring, 0)
Begin fromIndex with 0. Every time a substring is found, continue finding the substring by putting i+(length of the substring) to fromIndex
i = myString.indexOf(substring, i+substring.length)
Continue until indexOf returns -1, that is, substring is not found.