What is the difference between trim and trim$?
Printable View
What is the difference between trim and trim$?
To my knowledge, there is no difference. My VB help doesn't say anything about Trim$ though. I guess it's the same command. I guess there can be Mid$ too and it's no different from normal...
Correct if I'm wrong. But I can't think of any reason for them to be different.
Edit: just to notice, I've used VB for five years ;)
All string functions in VB have two versions, one with a $ and one without. The functions that end in a $ return a String while the others return a Variant (of string type). I was surprised that this wasn't mentioned in the help file.
The $ functions are somewhat faster than their counterparts because typically there is no need to perform any datatype conversions.
The reason might be that I have old Visual Basic 4 and it's help file. But it's very nice to know this :)
Iv'e read that the $ are ment to be used only for strings and the Mid() Trim() should be used for only integers.....but it works both ways...