private int countWhiteSpace(String phrase){
  int countBlank = 0;
  for(int i=0; i<phrase.length(); i++) {
    if(Character.isWhitespace(phrase.charAt(i))) {
        countBlank++;
    }
}
  return countBlank;
}