I am trying to create a method that will count number of zeros in a statement/numbers (numOfZero), that a string as input and returns the number of occurrence of ‘0’ in the string.
And if there is no zero it should return zero. I have used String.length() and String.CharAt(int index). but getting some errors. Any help?
m.mohamed
0
Newbie Poster
Recommended Answers
Jump to PostIt would help if you
- posted the code
- posted the errors and the corresponding line numbers
We can't answer questions in a vacuum.
All 2 Replies
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
rproffitt
2,580
"Nothing to see here."
Moderator
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.