Solved

VB.Net Arrays

Posted on 2004-09-08
4
211 Views
Last Modified: 2010-04-23
Hello, How do I clear a certain element in an array.

E.g.

      Dim myIntArray(1, 2) As String

        myIntArray(0, 0) = "One"
        myIntArray(0, 1) = "Two"
        myIntArray(0, 2) = "Three"
        myIntArray(1, 0) = "One One"
        myIntArray(1, 1) = "Two Two"
        myIntArray(1, 2) = "Three Three"


I want to clear the element where the text says "Two Two".

        Array.Clear(myIntArray, x, y)

What will x and y be and why..?

Thanks
0
Comment
Question by:sublimation
4 Comments
 
LVL 27

Expert Comment

by:planocz
ID: 12005959
Have you thought about using the ArrayList?
0
 
LVL 18

Accepted Solution

by:
deighton earned 250 total points
ID: 12005978
myIntArray.Clear(myIntArray, 4, 1)

its element index 4, zero based, so its the fifth element
0
 
LVL 4

Author Comment

by:sublimation
ID: 12006059
Hello, deighton.  

That seems to work well, can you tell me where the argument 1 comes into it please?

0
 
LVL 8

Assisted Solution

by:bramsquad
bramsquad earned 100 total points
ID: 12006105
y = 1 becuase its the length of how many to clear

if y = 2 then both (1, 1) and (1, 2) would clear

~b
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 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