code: public static int getCharCount(String charSet, String word)
      {
          int nCount = 0;
  
          if (word != null)
          {
              String temp = word + " ";
              for (int i = 0; i < word.length(); i++)
              {
                  String s = temp.substring(i, i + 1);
                  if (charSet.indexOf(s) != -1)
                      nCount++;
              }
          }
  
          return nCount;
      }
docs: 得到字符集的字符在字符串中出现的次数
  
  @param charSet
  @param word
  @return