class TextUtils {

    public static String trimEnd( String value, int length )
    {
        if ( value == null || length > value.length() )
        {
            return EMPTY;
        }

        return value.substring( 0, value.length() - length );
    }

}