Public Class MyLongClassName
Public Shared Name As String = "Ana"
Public Shared Function GetName() As String
Dim Name As String = "Beta"
'... this is toooooo long
Return MyLongClassName.Name
End Function
Public Shared Function GetName() As String
Dim Name As String = "Beta"
'... much better
Return This.Name '<--- there is any keyword for this?
End Function
End Class
I dont care only about long class names. Having a keyword to refer to the very class (like ‘this’ in static methods in Javascript) will be very useful along my journey.
2
Answers
The equivalent keyword is me. In place of This.
And this goes back to even VB days, and even VBA days
Thus
Edit:
As pointed out, me is not available in a shared class. So then just
Will work fine, and so will
To refer to a shared member within a shared method of the same class, you only have 2 choices: