Re: Trim and Trim$ by Bob
Bob
Thu Oct 23 09:18:34 CDT 2003
Tom Lavedas wrote:
> In what context. Trim$ is not supported in scripting,
Correct
> AFAIK. Also, AFAIK, it is only an alias supported in VB
> for backward compatibility to QuickBasic. I sincerely
> doubt there is any difference between the two.
There is a difference in VB/VBA: Trim$() (along with all the other string
functions when ended with a $: Right$, Left$, Mid$, etc.) returns a string,
whereas the non-$ versions return Variants (tring subtype). You cannot pass
an argument that may return a Null to a $ function, since a string variable
cannot be Null.
The $ versions of the functions are more efficient since they use less
memory.
Of course, they are not supported in scripting since only Variants exist in
vbscript.
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.