The TRIM intrinsic function returns a “trimmed” STRING; that is, the string without trailing blanks; its length is equal to LEN_TRIM(STRING).
Because character comparison ignores trailing blanks, TRIM(STRING) is always equal to STRING, but might have a different length.
Note that unlike LEN_TRIM, this is not elemental.