class CssUtils {

	public String stripDoubleSpacesAndTrim(final String str) {
		char[] charArray = str.toCharArray();
		if (str.contains("  ")) {
			StringBuilder builder = new StringBuilder();
			for (int i = 0; i < charArray.length; i++) {
				char c = charArray[i];
				if (c != ' ') {
					builder.append(c);
				} else {
					if (i + 1 < charArray.length && charArray[i + 1] != ' ') {
						builder.append(' ');
					}
				}
			}
			return builder.toString().trim();
		} else {
			return String.valueOf(charArray).trim();
		}
	}

	private  CssUtils();

}