code: @Nonnegative
    public static int getOccurrenceCount (@Nullable final String sText, final char cSearch)
    {
      int ret = 0;
      final int nTextLength = getLength (sText);
      if (nTextLength >= 1)
      {
        int nLastIndex = 0;
        int nIndex;
        do
        {
          // Start searching from the last result
          nIndex = getIndexOf (sText, nLastIndex, cSearch);
          if (nIndex != STRING_NOT_FOUND)
          {
            // Match found
            ++ret;
  
            // Identify the next starting position (relative index + number of
            // search strings)
            nLastIndex = nIndex + 1;
          }
        } while (nIndex != STRING_NOT_FOUND);
      }
      return ret;
    }
docs: Count the number of occurrences of cSearch within sText.
  
  @param sText
  The text to search in. May be <code>null</code>.
  @param cSearch
  The character to search for.
  @return A non-negative number of occurrences.