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

Converting a string of integers to an array/arraylist

I have a string of integer, such as the following:

"12 24 12 9 2"

and I want to convert this into an array or arraylist which will
seperate the string into an array of integers.

How do I do this
Jul 19 '05 #1
1 4468
A way to go could be to use the Split() method of the string class. This
returns an array of string where each element will contain one number
(represented as string). Then you could convert them using int.Parse() and
fill them into an array of int.

José
"Graeme Downes" <ag******@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
I have a string of integer, such as the following:

"12 24 12 9 2"

and I want to convert this into an array or arraylist which will
seperate the string into an array of integers.

How do I do this

Jul 19 '05 #2

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

Similar topics

5
by: matt melton | last post by:
Hi there, I am trying to write a method that accepts an array of any primitive type and will return the same array without copying memory as an array of bytes. ie. I'd like to be able to do...
1
by: Walter Zydhek | last post by:
Is it possible to convert an ArrayList to a string array? I have a routine that takes a string array as a parameter, converts it to an ArrayList for manipulation purposes, and now I need to...
1
by: Graeme Downes | last post by:
I have a string of integer, such as the following: "12 24 12 9 2" and I want to convert this into an array or arraylist which will seperate the string into an array of integers. How do I do...
6
by: Dan V. | last post by:
I would like to create a 2D string list (2D ArrayList ???). I would like to pass in a table or query as a parameter and have both columns transform into a 2D ArrayList. When I sort the one...
1
by: Yama | last post by:
Hi, I would like to convert (box and unbox) a string to ArrayList type. I tried the following: string arrayHeaderInfo = new string; stringHeaderSplitted = stringHeader.Split(","); ...
1
by: Alexander Widera | last post by:
hello, how can I convert a hashtable to an arraylist or array? I want to sort the hashtable... but this isn't posible, so i have to convert it to an hashtable. thank you, alex
17
by: Roshawn | last post by:
Hi, I have a small function that uses a For...Next loop. I am trying to place the results of the loop in a string array. My code is as follows: Dim i as Integer Dim str() as String For i =...
2
by: Earl | last post by:
I'm trying to do a cast and I'm not sure where I'm going wrong here. I load up the ColorExtIntID column (int) into a list array (no problem there). For binding to a 3rd party component, it has to...
5
by: stephen | last post by:
Hi, I have been working using VB .NET and I wanted to convert a code to C# in VB .Net I use modules so that I can declare variables, STP holders so that I can replace them easily when I move b/w...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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...

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.