public static int countOccurrences(String string, char occur) {
		int count = 0;
		int length = string.length();
		for (int i = 0; i < length; ++i) {
			if (string.charAt(i) == occur) {
				++count;
			}
		}
		return count;
	}
Returns a count of how many times the 'occur' char appears in the strings.

@param string the string to look inside
@param occur the character to look for/
@return a count of how many times the 'occur' char appears in the strings
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java