Question: In Java using netbeans Slenn Stevenson, MSJc Create a method called countDigits that will count all of the digit variables in a string. Your method
In Java using netbeans

Slenn Stevenson, MSJc Create a method called countDigits that will count all of the digit variables in a string. Your method should take as an argument the String to search through. enson,MSJ Glenn Stevenson, visJo Glenn Stevenson, MSJ It should return the number of digits that are within the string. For instance, given the following string, String str "1xyz34abc5" Your method would return 4 because there are 4 digits in the string. HINT: You should investigate the Character.isDigit method, It will simplify your code a great deal. Something like this Glenn Stevenson,MsJ ernson, MsJC String s "hello" if(Character.isDigit(s.charAt (0)))1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
