Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int countTokens(String sentence) {
- // Change or modify the return. This is here for now to prevent compiler
- // errors.
- int count = 0;
- Scanner s = new Scanner(sentence);
- while (s.hasNext())
- {
- s.next = count + 1;
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment