Solved

VB.Net Arrays

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now