Why is the following algorithm not halting for me? (str is the string I am searching in, findStr is the string I am trying to find)
String str = \"helloslkhe
You can number of occurrences using inbuilt library function:
import org.springframework.util.StringUtils; StringUtils.countOccurrencesOf(result, "R-")