ayozzhero
Well-known member
I read a few article suggesting the use of var = Nothing when the variable is no longer needed. What about in cases like this:
To be clear, I am confused whether to call the garbage collector when the code (sub) is actually ending.
Any idea is welcome.
Thanks for helping.
VB.NET:
[color=Blue]Private Sub[/color] Temp()
[color=Blue]Dim [/color]myString [color=Blue]As String[/color]
[color=Blue]For[/color] i [color=Blue]As Integer[/color] = 0 [color=Blue]To[/color] 10
myString = i
[color=Blue]Next[/color]
myString = [color=Blue]Nothing[/color]
[color=Blue]End Sub[/color]
To be clear, I am confused whether to call the garbage collector when the code (sub) is actually ending.
Any idea is welcome.
Thanks for helping.