[string]

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
 
C

Cor Ligthert[MVP]

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
 
H

Herfried K. Wagner [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top