473,386 Members | 2,050 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.

Need to split a String into an ArrayList

Hello,

I need to plit: "1,34,54,123,34"

Into an array list.

Thanks for any help,

Jack
Nov 20 '05 #1
2 7680
Jack,
Have you tried using String.Split to split the string into an Array, then
add the Array to the ArrayList.

Something like:
Dim values As String = "1,34,54,123,34"
Dim list As New ArrayList
list.AddRange(values.Split(","c))

Note: the ","c is a character literal, where as "," is a string literal.
They both contain a single comma.

Hope this helps
Jay

"jack" <ja**@mrolinux.com> wrote in message
news:eb**************@TK2MSFTNGP09.phx.gbl...
Hello,

I need to plit: "1,34,54,123,34"

Into an array list.

Thanks for any help,

Jack

Nov 20 '05 #2
Thank you very much for your help!!!!!
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uG**************@tk2msftngp13.phx.gbl...
Jack,
Have you tried using String.Split to split the string into an Array, then
add the Array to the ArrayList.

Something like:
Dim values As String = "1,34,54,123,34"
Dim list As New ArrayList
list.AddRange(values.Split(","c))

Note: the ","c is a character literal, where as "," is a string literal.
They both contain a single comma.

Hope this helps
Jay

"jack" <ja**@mrolinux.com> wrote in message
news:eb**************@TK2MSFTNGP09.phx.gbl...
Hello,

I need to plit: "1,34,54,123,34"

Into an array list.

Thanks for any help,

Jack


Nov 20 '05 #3

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

Similar topics

5
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it...
9
by: Java and Swing | last post by:
Say I have a string which contains numbers separated by a comma... such as "0,1,2,3,4,5"...I want to split the string at the commas and return an array containing, 0,1...5. Suggestions? I've...
7
by: TristaSD | last post by:
Hi, Need a string of random numbers from 1 to 6 generated by php, none of the numbers repeat, e.g. 142635, and NOT 114255. Thanks.
0
by: haridelphi | last post by:
Hi i'm working as a programmer using Borland developer studio 2006 (Delphi .net) in ASP.NET and C# (code behind) and postgreSQL (backend). I need connection string for it. Now i download...
2
by: Steven W. Orr | last post by:
I really tried. I give up. I got this one last time (for which I'm very grateful). import calendar months = dict() Now I want something that's going to give me a string whose value is the...
7
by: Johny | last post by:
I have a string of a variable length and I need to split the string in strings of 6 characters . But if the 6th character is not space then I must split the string at possition before the 6th...
5
by: shaiful | last post by:
Hi all I have a simple problem with string. I want to split string, such as: dim s as string dim k(3) as string s="aa1,bv1,cc1,dt1" i want to split the value in k, k(0)=aa1 k(1)=bv1...
17
by: Max347 | last post by:
This is my first post, so hopefully I can give enough information. I am running windows xp, using jGrasp to write code. I need to make a calculator in which the user inputs 2 floating point numbers...
4
by: dmitrey | last post by:
hi all, howto split string with both comma and semicolon delimiters? i.e. (for example) get from string "a,b;c" I have tried s.split(',;') but it don't work Thx, D.
4
by: N9 | last post by:
Hi Anyone who can help about split string. string text = "History about a boy, who loves to play baseball with his friends." I like to find indexOf "play" and read the string 10 char left...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
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.