Results 1 to 3 of 3

Thread: Split string function

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Utah
    Posts
    12

    Split string function

    My problem is that I have a string delimited by the "~":

    Ex.
    A1~1~000 9999999 999~99999~The Name of a company~99999~2800 Street Name~~MIDDLETOWN~PA~17057~UNITED STATES~PA~17057~UNITED STATES0~~~~

    When I use the split function

    Data() = Split(arr(r), "~")

    I get this in my array

    A1
    1
    000 9999999 999
    99999
    The Name of a companuy
    99999
    2800 Street Name

    MIDDLETOWN
    PA
    17057
    UNITED STATES
    PA 'This element should be empty
    17057 'This element should be empty
    UNITED STATES0 'This element should be empty



    Why am I geting duplicate data in different elements of my array?
    I can not figure this one out!

    JBush

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    take a look at your original string...the info is duplicated, that's why it's duplicating in the array
    VB Code:
    1. A1~1~000 9999999 999~99999~The Name of a company~99999~2800 Street Name~~MIDDLETOWN~[color=red]PA~17057~UNITED STATES~[/color][color=blue]PA~17057~UNITED STATES0~[/color]~~~

  3. #3
    Lively Member rc1980's Avatar
    Join Date
    Sep 2001
    Posts
    106
    LMAO!! The thing is, I looked at that and totally missed it...hahaha...too funny!

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