Fred,
Square brackets [ ] allow a keyword to be used as an identifier. Seeing as
String is a VB.NET alias for System.String, using [String] or String to
represent System.String are all identical.
Where you really need it is for Enum & Delegate, as both are keywords used
to define new types, so if you wanted use the System.Enum or System.Delegate
type you either need to qualify them with System or escape them
Dim values() as String = [Enum].GetValues(GetType(MyEnum))
Escaped identifiers are also useful when you want to use a keyword for a
method name.
Public Class Car
Public Sub Start()
End Sub
Public Sub [Stop]()
End Sub
End Class
Without an escaped identifier you would need to have the Car.Stop method
called something else, which may not be as obvious as to what the method
does...
Hope this helps
Jay
"Fred Morrison" <fm*******@erols.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
I've seen numerous examples of
Dim x as [String]
but can't for the life of me find anything in online help in VS 2003 or
the dozen or so .Net books I have. Is this anything like the old Dim x$
technique from a long time ago or is it something completely new to
Vb.Net?