If those answers sound too advanced, let's look at doing the work in smaller steps.
The String class has a method that will give you an array of char. The Character class has methods to tell if a char is a digit or whitespace.
Can you imagine a loop through the array, checking each character, adding to counters for digits and whitespace? Give it a shot and show us what you make. We can help you best with "almost working" code.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: May 06, 2004
Regexes are definitely not the tool for this job. It will be far easier to iterate through the characters yourself, as Stan suggested (and that's almost certainly what your instructor is expecting you to do). [ January 31, 2007: Message edited by: Alan Moore ]