•KFC• • •KFC• Регистрация 14 Ноя 2013 Сообщения 86 Репутация 0 Спасибо 0 Монет 0 1 Дек 2016 #1 public static void main(String[] args) { String str ="Hello World"; String[] words = str.split("s"); int wordCount= 0; int i, wordsSize= words.length; for(i=0; i<wordsSize; ++i) if(words!=null && !"".equals(words)) ++wordCount; System.out.println("Word count="+wordCount); }}
public static void main(String[] args) { String str ="Hello World"; String[] words = str.split("s"); int wordCount= 0; int i, wordsSize= words.length; for(i=0; i<wordsSize; ++i) if(words!=null && !"".equals(words)) ++wordCount; System.out.println("Word count="+wordCount); }}