Est-ce votre entreprise ?
Write a program to count words in a string?
Utilisateur anonyme
void countWords(String text) { Map wordCount = new HashMap(); List words = Arrays.asList(text.split(" ")); for (String word : words) { if (wordCount.containsKey(word)) { wordCount.put(word, wordCount.get(word) + 1); } else { wordCount.put(word, 1); } } }