[string]

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I've noticed in some msdn examples that they have an object type as string..
but looks something like
hoststring as [String]...
what do the [ ] mean in vb.net
 
Brian,

Breakets in VB means that the name can be used again.,

Like this
dim [String] as string

Not so clever but some samples on MSDN seems to be written by C++ writters.

Cor
 
Michael D. Ober said:
I've noticed in some msdn examples that they have an object type as
string.. but looks something like
hoststring as [String]...
what do the [ ] mean in vb.net
The [] is an escape sequence that is used when there is a VB.NET keyword
that is overriding a framework or class keyword (name, method, etc.). In
this case, [String] is directly referencing the framework class
System.String instead of the VB String class.

There is no "VB String class". The 'String' keyword simply maps to
'System.String'. Thus the brackets in the quoted sample are rather useless.
 
Back
Top