Java Periksa apakah string berisi banyak kata

String str1 = "It's a great day today.";
        
String[] words = str1.split(" "); 
//["It's", "a", "great", "day", "today."]

boolean hasMultipleWords = words.length > 1;

System.out.println(hasMultipleWords);
Nia Nancheva