CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Trim and Trim$

  1. #1
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    Trim and Trim$

    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


  2. #2
    Join Date
    Jul 2000
    Location
    London, England
    Posts
    89

    Re: Trim and Trim$

    Trim$ uses less memory


  3. #3
    Join Date
    Feb 2001
    Location
    PA
    Posts
    163

    Re: Trim and Trim$

    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.


  4. #4
    Join Date
    Apr 2001
    Posts
    95

    Re: Trim and Trim$

    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/de...rpDataType.htm


  5. #5
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: Trim and Trim$

    Not only that it consumes less memory, but it does process faster (somewhere around 10% if I remember).

    David Paulson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured