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.
here is the code but it showing errors in 4 casee out of 11 why.
import java.io.;
import java.util.;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
scan.close();
// Split the string into tokens
String[] tokens = s.split("[ !,?._'@]+");
// Print the number of tokens
System.out.println(tokens.length);
// Print each token on a new line
for (String token : tokens) {
System.out.println(token);
}
}
Java String Tokens
You are viewing a single comment's thread. Return to all comments →
here is the code but it showing errors in 4 casee out of 11 why.
import java.io.; import java.util.;
public class Solution {
}