By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,543 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

Data Types

P: n/a
Hello

What is the difference between these lines:
Private Shared s as [String]
Private Shared s as String
Thank you
serban
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Serban,
Nothing.

In VB.NET when you want to use a keyword for an identifier you include the
keyword in square brackets. This is known as an 'Escaped Identifier'.

http://msdn.microsoft.com/library/de...fVBSpec2_2.asp

For example, if I wanted to create a variable named string I would use:

Private Shared [string] As String

Then when I wanted to use the variable named string:

[string] = "Hello World!"

Seeing as String is a keyword that happens to be an alias for the
System.String datatype. In your example String & [String] both refer to
System.String, so there is no difference.

Hope this helps
Jay

"serban" <sc****@hotmail.com> wrote in message
news:00****************************@phx.gbl...
Hello

What is the difference between these lines:
Private Shared s as [String]
Private Shared s as String
Thank you
serban

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.