code: public static int count(String keyword, String srcText)
      {
          int count = 0;
          int leng = srcText.length();
          int j = 0;
          for (int i = 0; i < leng; i++)
          {
              if (srcText.charAt(i) == keyword.charAt(j))
              {
                  j++;
                  if (j == keyword.length())
                  {
                      count++;
                      j = 0;
                  }
              }
              else
              {
                  i = i - j;// should rollback when not match
                  j = 0;
              }
          }
  
          return count;
      }
docs: 统计 keyword 在 srcText 中的出现次数
  
  @param keyword
  @param srcText
  @return