You are viewing a single comment's thread. Return to all comments →
this code is not working for test case 9 please anyone kindly help me to solve this problem
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(); String[] str=s.trim().split("[\s,._;@'?!]+"); if(str.equals("")) { System.out.println("0"); } else { System.out.println(str.length); for(int i=0;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 →
this code is not working for test case 9 please anyone kindly help me to solve this problem
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(); String[] str=s.trim().split("[\s,._;@'?!]+"); if(str.equals("")) { System.out.println("0"); } else { System.out.println(str.length); for(int i=0;i