Click to See Complete Forum and Search --> : Trim and Trim$
vchapran
May 8th, 2001, 10:39 AM
What is the difference between these functions? Trim returns variant, containing string, and Trim$ returns just string. What does it do in practical use?
Or there are some other differences?
Thank you.
Vlad
Styler
May 8th, 2001, 12:01 PM
Trim$ uses less memory
Cubbie
May 8th, 2001, 12:36 PM
Someone correct me if I'm wrong but specifically if I remember correctly the Variant data type uses a minimum of 16 bytes plus 1 for each character, whereas the string data type uses 1 byte per character.
slcotten
May 8th, 2001, 01:01 PM
Actually I think that Left uses 22 bytes plus string length and Left$ uses 10 bytes plus string length.
See http://msdn.microsoft.com/library/default.asp?URL=/library/devprods/vs6/vbasic/vbenlr98/vagrpDataType.htm
d.paulson
May 8th, 2001, 01:18 PM
Not only that it consumes less memory, but it does process faster (somewhere around 10% if I remember).
David Paulson
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.