Public Function MethodOne(ByVal s As String) As String
Dim sb As New StringBuilder()
sb.Append(s)
sb.Append(MethodTwo())
return sb.ToString()
End Function
Public Function MethodTwo() As String
Dim i As Integer = 0
For index As Integer = 0 To 5
i = index
Next
return i.ToString()
End Function
I want to retain the value of i, but once it goes back into MethodOne, it loses its value. I tried making it static i As integer = 0, but this did not work.
sorry misread that. How about creating a property called Count, and update it whenever MethodTwo is called. You can use the Property Count in MethodTwo instead of i.