Be very careful here. Trim returns a variant not a string, which does indeed mean that it can return NULL if asked passed NULL as a parameter. Trim$, on the other hand, returns a genuine string, and will error if the parameter passed to it is NULL.
This observation is true for almost all of the string manipulation functions which have variant and true string versions.
In my opinion, the use of variants should be discouraged where possible for a variety of reasons, the main one being that they are a combination of weak-typing and implicit casting, which can lead to unexpected errors.
Actually, maybe this is an example of the sort of topic that CajunCenturion is looking to discuss in thread222-316590...