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
Medium Priority
231 Views
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
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

LVL 27

Expert Comment

ID: 12005959
Have you thought about using the ArrayList?
0

LVL 18

Accepted Solution

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

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

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

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…
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
Course of the Month9 days, 13 hours left to enroll