Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I need to know how to trim to size an array or to know how to put the array in an arraylist so I can trim it to size with

 

myArrayList.TrimToSize

 

OR Can you tell me how to get rid of an element that has nothing in it

 

MyArr is showing 6 items when there is only 5 items in it, so when I went to debug it I found an element that is null like this

1 = 1

2 = 2

3 = 3

4 = 4

5 = 5

6 = "" <----------- I need to kill this element to uterly destroy to never see it again LOL But how oh great ones :)

 

Sorry went off the deep end there for a sec

 

My thought was if I put into an ArrayList then I could use the TrimToSize to settle it :)

 

What do you think I should do

 

vbMarkO

Visual Basic 2008 Express Edition!
  • *Experts*
Posted

I'm going to ask what might be a stupid question, but why do you need to trim the array?

For i = 0 to myArray.GetUpperBound(0)
   If Not myArray(i) = Nothing Then
       'blah
   End If
Next

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...