Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Mar 31st, 2008, 6:13 AM   #1
csrocker101
Programmer
 
Join Date: Dec 2006
Posts: 50
Rep Power: 2 csrocker101 is on a distinguished road
Help Indexing ArrayList

Hey everyone I have made an arraylist that takes a stream of information from a string I have made that contains some IP addresses. However I am having a problem assigning the information correctly to my ArrayList. Each IP address is approxiamtely 13 characters long. Here is my code..

string IPAdressesofSystems = service.GetNearbySystems(host);
            ArrayList newList = new ArrayList();

            for (int i = 0; i < IPAdressesofSystems.Length; i++)
            {
                newList.Add(IPAdressesofSystems.Substring(i, 13));
            }

I am well aware it's because of the "i" index I am using in my Substring method is starting at the next incremented index. For example it starts out doing "index[0] = 150.542.234.23 index[1] = 45.543.245.21 index[2] = 4.342.233.29..etc.." because the i is incrementing by one which is making the starting index go up by one everytime. How would I make it so it records all 13 characters of Each IP adress?
csrocker101 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ArrayList Start Index kruptof C# 8 Sep 2nd, 2007 11:20 AM
Problem with an ArrayList Twilight C# 2 Apr 25th, 2006 2:15 PM
ArrayList and MSDN Writlaus C++ 13 Apr 5th, 2006 4:27 AM
ArrayList Troubles crawforddavid2006 Java 17 Jan 10th, 2006 7:37 PM
Converting object to arraylist yusufozkay C# 1 Jul 18th, 2005 9:08 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:18 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC