public void formatStringTwo(char[] str, int length) {
		boolean isWord = false;
		int wordCount = 0;
		for (int i = 0; i < length; i++) {
			if (str[i] != ' ' && isWord == false) {
				isWord = true;
				if (wordCount > 0) {
					System.out.print(' ');
				}
				wordCount++;
				System.out.print(str[i]);
			} else if (str[i] == ' ' && isWord == true) {
				isWord = false;
			} else if (str[i] != ' ' && isWord == true) {
				System.out.print(str[i]);
			}
		}
	}