Answers for "count"

-2

count

//Calculate the times a character occurs
	public static int charCount(String userInput) {
		
		//convert the string to a char array
		char[] StringArray = userInput.toCharArray();
		
		//hashmap that stores the characters. key will be the time it occures
		HashMap<Character, Integer>charCount = new HashMap<Character, Integer>();
Posted by: Guest on March-20-2020

Browse Popular Code Answers by Language