Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB.Net Arrays

Posted on 2004-09-08
4
Medium Priority
?
231 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 1000 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

722 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