You are viewing a single comment's thread. Return to all comments →
// Write your code here. String trimmed=s.trim(); String[] tokens = trimmed.split("[ !,?._'@]+"); int tokenCount=0; for(String token: tokens){ if(!token.isEmpty()){ tokenCount++; } } System.out.println(tokenCount); for (String token : tokens) { System.out.println(token); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java String Tokens
You are viewing a single comment's thread. Return to all comments →