When using the LEN() function, be aware that before calculating the length of the passed string, SQL seems to perform an RTRIM() on the string, hence
LEN('ABCDE') = 5
and
LEN('ABCDE ') = 5
You could consider using the DATALENGTH() function, however as this returns the number of bytes, this would give double the number of characters if you passes if an NVARCHAR or NCHAR string
I had thought that perhaps toggling ANSI_PADDING would have some effect on this, however that proves not to be the case.
As a work around, I append a character ('|') to the end of the string, then check the length of the string - 1.
Also worth noting here, when comparing 2 strings, trailing blanks also seem to be ignored:
i.e. 'ABCDE' = 'ABCDE '
However please post if you have a better solution