Results 1 to 5 of 5

Thread: Trim

  1. #1

    Thread Starter
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Trim

    What is the difference between trim and trim$?

  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    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
    Last edited by Merri; Nov 8th, 2002 at 03:17 AM.

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    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.

  4. #4
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    The reason might be that I have old Visual Basic 4 and it's help file. But it's very nice to know this

  5. #5
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    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...

    Visual Studio 6, Visual Studio.NET 2005, MASM

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