[String]

G

Guest

I've been seeing syntax like: [String].Empty in VB.net code and can not find any explaination for the brackets []
 
R

Robert Jacobson

The brackets are generally used to escape kewords. For example, if you're
defining a class with a property "End", you'd need to escape it so the
compiler won't treat it as a keyword:

Public Class Foo
Public Property [End] as Integer
...
End Propety
End Class

However, there's no need to escape "String.Empty." The code should run fine
without the brackets.


gt said:
I've been seeing syntax like: [String].Empty in VB.net code and can not
find any explaination for the brackets [] ?
 

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