473,386 Members | 1,810 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,386 software developers and data experts.

Question: Splitting A String

I have a string, which can have one or more elements, seperated by a "##"
delimiter. Here's some examples:

One
One##Two##Three
One##Two##Three##Four##Five

How can I take the string and fill a LISTBOX based on each item?

I know Split can split the strings, but how do I know how many "items"
exist, etc...?

Or you might know a better way....
Feb 1 '06 #1
2 983
If I understand what you're asking, then the following code might help:

Dim TestString As String
TestString = "test1##test2##test3"
Me.ListBox1.DataSource = Split(TestString, "##")
Me.ListBox1.DataBind()

You don't need to know how many items there are in the string in order to
bind to a list box, but if you want to know, you could use:
Me.ListBox1.Items.Count
or
Split(TestString, "##").Length

"VB Programmer" <do**@emailme.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
I have a string, which can have one or more elements, seperated by a "##"
delimiter. Here's some examples:

One
One##Two##Three
One##Two##Three##Four##Five

How can I take the string and fill a LISTBOX based on each item?

I know Split can split the strings, but how do I know how many "items"
exist, etc...?

Or you might know a better way....

Feb 1 '06 #2
Thanks!
"Kim Quigley" <ki********@hotmail.com> wrote in message
news:OD**************@TK2MSFTNGP09.phx.gbl...
If I understand what you're asking, then the following code might help:

Dim TestString As String
TestString = "test1##test2##test3"
Me.ListBox1.DataSource = Split(TestString, "##")
Me.ListBox1.DataBind()

You don't need to know how many items there are in the string in order to
bind to a list box, but if you want to know, you could use:
Me.ListBox1.Items.Count
or
Split(TestString, "##").Length

"VB Programmer" <do**@emailme.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
I have a string, which can have one or more elements, seperated by a "##"
delimiter. Here's some examples:

One
One##Two##Three
One##Two##Three##Four##Five

How can I take the string and fill a LISTBOX based on each item?

I know Split can split the strings, but how do I know how many "items"
exist, etc...?

Or you might know a better way....


Feb 1 '06 #3

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

Similar topics

11
by: sneill | last post by:
I have read a number of posts on the use of eval() in Javascript, and I agree that its use is questionable. But it does beg the following question: "How arbitrary does a string need to be before...
6
by: Earl Anderson | last post by:
I have a A97/XP applet I've developed for my own use in my department. My boss "suggests" that since I built it, I share it with and instruct the other 6 members of my department on its use. I've...
18
by: Andre Laplume via AccessMonster.com | last post by:
I have inherited a bunch of dbs which are are shared among a small group in my dept. We typically use the dbs to write queries to extract data, usually dumping it into Excel. Most dbs originated...
7
by: Peter Proost | last post by:
Hi, I'm creating an import module to read data from old textfiles, run some calculations on them and save them to sql server. I've figured out how to do a select on textfile using a schema.ini file...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
20
by: Opettaja | last post by:
I am new to c# and I am currently trying to make a program to retrieve Battlefield 2 game stats from the gamespy servers. I have got it so I can retrieve the data but I do not know how to cut up...
10
by: Avi | last post by:
Hi I need to read in a large set of text files (9GB+ each) into a database table based on fixed width lengths. There are several ways to complete this, but I am wondering if anyone has...
2
by: CharChabil | last post by:
Using Vb.net 2005, I want to read each part in this string in an array (splitting the string) ----------- A1/EXT "BK82 LB73 21233" 105 061018 1804 ----------- That Code that i used is as follow:...
13
by: John Kraft | last post by:
Friends, I'm working on some crud stuff, and I was looking for opinions on the subject. Below, I have pasted some VERY simple sample code. Class2 is a "traditional" crud type object. In a...
2
by: shadow_ | last post by:
Hi i m new at C and trying to write a parser and a string class. Basicly program will read data from file and splits it into lines then lines to words. i used strtok function for splitting data to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.