Marcelo Antonio Aravena Lobos

Greenhorn
+ Follow
since Feb 07, 2019
Marcelo Antonio likes ...
IntelliJ IDE Spring Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marcelo Antonio Aravena Lobos

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
5 years ago
Hi Wayne and Campbell, I'm new in CodeRanch, I would like to add my two cents to the problem
but of course Wayne do as your Instructor at Bootcamp tells you, this is just my opinion to the problem and a possible answer.
The best answer anyway is always using Regular Expressions as Campbell mentioned it before.



Marcelo Aravena
5 years ago