Parsing a string

  • Thread starter Thread starter Mike Kanski
  • Start date Start date
M

Mike Kanski

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?
 
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
 
Back
Top