private static int trimEnd( String str, int beginIndex, int endIndex ) {
		// skip trailing whitespace
		while( beginIndex < endIndex && str.charAt( endIndex - 1 ) <= ' ' )
			endIndex--;
		return endIndex;
	}
This is equal to {@code str.trim().isEmpty()},
but avoids temporary trimmed substring allocation.

@since 2
flatlaf-core/src/main/java/com/formdev/flatlaf/util/StringUtils.java