We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I'm realy close to solve that problem but test no 9, he didn't give up. i fail that test, the single one.
could you help me with an hint?
My solution is this:
Scanner scan = new Scanner(System.in);
String s = scan.nextLine().trim();
String[] tokens = s.split("[ !,?._'@]+");
System.out.println(tokens.length);
for (int i = 0; i < tokens.length; ++i) {
System.out.println(tokens[i]);
}
scan.close();
Cookie support is required to access HackerRank
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 →
Hello !!
I'm realy close to solve that problem but test no 9, he didn't give up. i fail that test, the single one. could you help me with an hint? My solution is this: