Solved

- Array Help Needed -

Posted on 2004-08-24
2
195 Views
Last Modified: 2010-04-23
i am useing VB.NET, and i am working within a windows form.

how can i delete an item in an array?
i know how to clear it, but i would like to remove that item so that all of the items following it will move up one position.

can this be done without having to write code to copy the next item and paste it up one position, and having to repeat that for each item in the array that follows the deleted item. my array is very large so i would like to avoid doing that.

thanks.
0
Comment
Question by:moe10
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 77 total points
ID: 11878626
You can't do that in an (in an easy way ) array use an arraylist instead, like this

        Dim g As New ArrayList
        g.Add("test1")
        g.Add("test2")
        g.Remove("test1")
        MsgBox(g.Item(0))
0
 
LVL 8

Expert Comment

by:wguerram
ID: 11904684
What type of data are you using in your array?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question