uglyDuckling = removeDuplicateSpaces(uglyDuckling);
uglyDuckling = removeDuplicateSpaces(uglyDuckling.trim());
    public static String prettyPrint(String uglyDuckling) {        uglyDuckling = removeDuplicateSpaces(uglyDuckling);        String[] lowerCaseName = uglyDuckling.toLowerCase().split(" ");        StringBuffer capitalizedName = new StringBuffer();        for (int i = 0; i < lowerCaseName.length; i++) {            if (!containsNoneSpecialChars(lowerCaseName[i]) && !allCapSet.contains(lowerCaseName[i])) {                capitalizedName.append(capitalizeWordWithSpecChars(lowerCaseName[i]));            } else {                // The first word is always capitalized (some courses' name                // begin with an article)                // (ex: Os Lseres na Instrumentao e Medida)                if (i == 0) {                    capitalizedName.append(WordUtils.capitalize(lowerCaseName[i]));                } else {                    // Exception to the general case: if "A" is the last word                    // converts to UPPERCASE                    // (needed for courses that occur in alternative semesters)                    if (i == (lowerCaseName.length - 1) & lowerCaseName[i].equals("a")) {                        capitalizedName.append(lowerCaseName[i].toUpperCase());                    } else {                        capitalizedName.append(capitalizeWord(lowerCaseName[i]));                    }                }            }            capitalizedName.append(" ");        }        return capitalizedName.toString().substring(0, capitalizedName.length() - 1);    }