You are viewing a single comment's thread. Return to all comments →
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws IOException{ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String myStr = reader.readLine().trim(); if (myStr == null || myStr.isEmpty()) { System.out.println(0); } else { String[] myStrArr = myStr.split("[!?,._'@\\s]+"); System.out.println(myStrArr.length); for (String i : myStrArr) { System.out.println(i); } } }
}
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 →
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;
public class Solution {
}