Parsing a string

Discussion in 'ASP .Net' started by Mike Kanski, Oct 20, 2003.

  1. Mike Kanski

    Mike Kanski Guest

    Here's an expample:

    dim s as string
    s=""c:\blah blah\"" ""c:\koko\"" ""c:\booo boo\""
    console.write ubound(s.split(""" """))

    result of ubound is 3
    Should be 2 !

    What i'm trying to do is to say that the delimeter in the string is DOUBLE
    QUOTE SPACE DOUBLE QUOTE (" ")
    And Split still counts all the spaces!
    Any suggestions?
     
    Mike Kanski, Oct 20, 2003
    #1
    1. Advertising

  2. Wim Hollebrandse, Oct 20, 2003
    #2
    1. Advertising

  3. Mike Kanski

    Jerry III Guest

    Isn't this because VB arrays are 1 based? So your split will give you an
    array with 1, 2 and 3 indexes, so the ubound is 3 and lbound is going to be
    1. I think this is the expected behavior in VB.

    Jerry

    "Mike Kanski" <> wrote in message
    news:%23eaT$...
    > Here's an expample:
    >
    > dim s as string
    > s=""c:\blah blah\"" ""c:\koko\"" ""c:\booo boo\""
    > console.write ubound(s.split(""" """))
    >
    > result of ubound is 3
    > Should be 2 !
    >
    > What i'm trying to do is to say that the delimeter in the string is DOUBLE
    > QUOTE SPACE DOUBLE QUOTE (" ")
    > And Split still counts all the spaces!
    > Any suggestions?
    >
    >
     
    Jerry III, Oct 21, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GIMME
    Replies:
    2
    Views:
    877
    GIMME
    Feb 11, 2004
  2. Naren
    Replies:
    0
    Views:
    586
    Naren
    May 11, 2004
  3. Christopher Diggins
    Replies:
    0
    Views:
    613
    Christopher Diggins
    Jul 9, 2007
  4. Christopher Diggins
    Replies:
    0
    Views:
    442
    Christopher Diggins
    Jul 9, 2007
  5. John Levine
    Replies:
    0
    Views:
    738
    John Levine
    Feb 2, 2012
Loading...

Share This Page