Results 1 to 3 of 3

Thread: clear arrays...

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    clear arrays...

    i am a little shy of asking this dumb question but how do i clear an array? i am used to use arraylists whom have a .Clear() method but arrays doesnt seem to support it...will i have to loop thru the whole array and set each member to nothing/null?
    \m/\m/

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: clear arrays...

    here you go !
    VB Code:
    1. Dim str() As String = {"0", "1"}
    2.  Array.Clear(str, 0, str.Length)
    3. 'check it's empty
    4. MsgBox(str(0) & "--" & str(1))

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    or you can directly use the declared array . like this
    VB Code:
    1. str.Clear(str, 0, str.Length)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width