I am trying to make a program on word count which I have partially made and it is giving the correct result but the moment I enter space or more than one space in the string
String data = "This world is mine"; System.out.print(data.split("\\s+").length);