473,394 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Parsing a string

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?
Nov 17 '05 #1
4 1134
The UBound simply gives you the count of the result array, being split by your " ".

If you sawed a log into three pieces, you'd have to saw it twice.

;)

Cheers,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #2
The UBound simply gives you the count of the result array, being split by your " ".

If you sawed a log into three pieces, you'd have to saw it twice.

;)

Cheers,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #3
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" <mk*****@asi-solutions.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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?

Nov 17 '05 #4
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" <mk*****@asi-solutions.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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?

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
6
by: BerkshireGuy | last post by:
Does anyone know of a good function that will parse out parts of an SQL statement that is passed to it in seperate variables? It should be able to parse statements that contain ORDERBY, WHERE,...
9
by: Paulers | last post by:
Hello, I have a log file that contains many multi-line messages. What is the best approach to take for extracting data out of each message and populating object properties to be stored in an...
3
by: Anup Daware | last post by:
Hi Group, I am facing a strange problem here: I am trying to read xml response from a servlet using XmlTextWriter. I am able to read the read half of the xml and suddenly an exception:...
3
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def...
2
by: RG | last post by:
I am having trouble parsing the data I need from a Serial Port Buffer. I am sending info to a microcontroller that is being echoed back that I need to remove before I start the actual important...
6
by: gw7rib | last post by:
I have a program that needs to do a small amount of relatively simple parsing. The routines I've written work fine, but the code using them is a bit long-winded. I therefore had the idea of...
1
by: hd95 | last post by:
In a perfect world my xml feed source would produce perfect xml ..that is not the case I am parsing an XML feed that sometimes has ampersands and dashes in the content that messes up my parsing. ...
1
by: eyeore | last post by:
Hello everyone my String reverse code works but my professor wants me to use pop top push or Stack code and parsing code could you please teach me how to make this code work with pop top push or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.