Data Types

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • serban

    #1

    Data Types

    Hello

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


    Thank you
    serban
  • Jay B. Harlow [MVP - Outlook]

    #2
    Re: Data Types

    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" <schitu@hotmail .com> wrote in message
    news:00aa01c371 61$dc088c60$a10 1280a@phx.gbl.. .[color=blue]
    > Hello
    >
    > What is the difference between these lines:
    > Private Shared s as [String]
    > Private Shared s as String
    >
    >
    > Thank you
    > serban[/color]


    Comment

    Working...