Solved

VB.Net Arrays

Posted on 2004-09-08
4
225 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
[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
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

734 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