Parsing a string

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?
 
J

Jerry III

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top