Results 1 to 4 of 4

Thread: [vb6] trimming from beginning..

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    128

    [vb6] trimming from beginning..

    ok, so im recieving a packet, and all I want to do is trim the first 4 bytes off of the beginning, and have the remainder, anybody know how to do this?

    btw, $right(string, len(string)-4) doesn't work, it just gives me a byref mismatch error because its hex, I guess.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [vb6] trimming from beginning..

    The Right function shouldn't give that error, and it doesn't matter what the string contains.
    vb Code:
    1. str = Right$(str, Len(str) - 4)
    2. 'you can also use the Mid$ function:
    3. str = Mid$(str, 5)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    128

    Re: [vb6] trimming from beginning..

    ok, the mid worked perfect (except to take off 4 characters i needed to enter 7, lol), thanks alot.

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [vb6] trimming from beginning..

    If you enter 7 it will remove 6 characters and not 4... But I'm glad you've got it working.

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