Reputation: 60751
i have this:
Dim split As String() = temp_string.Split(",")
''#feed all info into global variables
patient_id = split(0)
doc_name = split(1)
lot__no = split(2)
patient_name = split(3)
how do i clear all the contents of split() ?
Upvotes: 6
Views: 32443
Reputation: 381
No need to do anything. The garbage collector will do its jobs clearing the variable. Explicitly set every variable to nothing will slow down your application.
Upvotes: 5
Reputation: 158309
You can always set it to Nothing
which will clear the reference. Then the garbage collector will take care of the rest when it finds that to be a good idea.
split = Nothing
However, if this is a local variable of a method you would typically not need to worry about this, the array will be available for garbage collection as soon as it goes out of scope.
Upvotes: 4