src/main/java/com/zandero/utils/StringUtils.java
public static String trimDoubleSpaces(String value) {

		if (isNullOrEmpty(value)) {
			return value;
		}

		value = value.trim();
		return value.replaceAll("\\s+", " ");
	}
public static String trimDoubleSpaces(String value) {

		if (isNullOrEmpty(value)) {
			return value;
		}

		value = value.trim();
		return value.replaceAll("\\s+", " ");
	}
public static String trimDoubleSpaces ( String value ) { if ( isNullOrEmpty ( value ) ) { return value ; } value = value . trim ( ) ; return value . replaceAll ( "\\s+" , " " ) ; }
Additionally to outer <code>trim()</code> double spaces are removed.

@param value to remove double spaces from
@return value with single spaces if any
Additionally to outer <code > trim () < / code > double spaces are removed .