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?
Printable View
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?
here you go !
VB Code:
Dim str() As String = {"0", "1"} Array.Clear(str, 0, str.Length) 'check it's empty MsgBox(str(0) & "--" & str(1))
or you can directly use the declared array . like this
VB Code:
str.Clear(str, 0, str.Length)