I would like to get the name of a property, for example:
Dim _foo As String
Public Property Foo as String
Get
Return _foo
End Get
Private Set(ByVal value as String)
_foo = value
End Set
Sub Main()
Console.Write(Foo.Name)'Outputs "Foo"
End Sub
Any ideas how?
Do you mean a property, or do you mean a field?
There are clever lambda techniques for getting the names of properties – here’s a C# example:
Call it like this:
and it will return “MyProperty”
Not sure if that’s what you’re after or not.