Skip to content
Advertisement

Tag: switch-statement

Count words, java

I want to count words. I use the methods hasNextChar and getChar. The sentence may contain all kind of chars. Here’s my code: It works so far but e.g. when I have a ” . ” at the end it gives me 8 instead of 7 words. Here are some examples of sentences: *„Schreiben Sie ein Praktikanten-Vermittlungs-Programm“ – words: 6

Advertisement