Hi Campbell, you are right with Scanner, \n could be completely avoided as you mention, I just left it as the original code but you are right in your comments
I used break in order to don't iterate over long words let's say a String with hundred of characters, break allow me to just go away from the loop at once, and iterators tells me always how many iterations has been made.
Regarding the characters at zero and one index, if not digits they will go in the else statement and then with a break it won't count it.
There are many ways to approach this code problem as you mention.
Thank you again for your comments and advices Campbell.
It's good to be here at JavaRanch, thanks again guys.
Marcelo Aravena