code: public static int count(final String host, final String searchStr) {
      int count = 0;
      for (int startIndex = 0; startIndex < host.length(); startIndex++) {
        int findLoc = host.indexOf(searchStr, startIndex);
        if (findLoc == -1) {
          break;
        } else {
          count++;
          startIndex = findLoc + searchStr.length() - 1;
        }
      }
      return count;
    }
docs: count inner string in host string
  
  @param host
  a {@link java.lang.String} object.
  @param searchStr
  a {@link java.lang.String} object.
  @return a int.