Is there a simple way to determine if a string (i.e. "Dim") is a keyword for VB.NET.
I could create a list of keywords, and loop through them, but I was hoping for something more reliable.
Is there a simple way to determine if a string (i.e. "Dim") is a keyword for VB.NET.
I could create a list of keywords, and loop through them, but I was hoping for something more reliable.
There is no built-in way to do this, so you have to maintain your own list.
Depending on how you intend to use it, a HashSet(Of T)
could be used to provide better performance than a List(Of T)
or an array.
Microsoft has got a list of VB.NET's Keywords here.