difference between String and string

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

    difference between String and string

    I notice in my code that is String is typed with an uppercase S it is
    coloured light blue in the IDE and if it is typed in the lowercase
    string then it is displayed in dark blue.

    Can someone explain why this is, and what the difference between these
    two versions of string is please.

  • Bob Powell [MVP]

    #2
    Re: difference between String and string

    string is a compiler shortcut for System.String. They're the same thing.

    --
    Bob Powell [MVP]
    Visual C#, System.Drawing

    Ramuseco Limited .NET consulting


    Find great Windows Forms articles in Windows Forms Tips and Tricks


    Answer those GDI+ questions with the GDI+ FAQ


    All new articles provide code in C# and VB.NET.
    Subscribe to the RSS feeds provided and never miss a new article.



    "CCLeasing" <gary@ccleasing .co.ukwrote in message
    news:1163154739 .290592.280310@ h54g2000cwb.goo glegroups.com.. .
    >I notice in my code that is String is typed with an uppercase S it is
    coloured light blue in the IDE and if it is typed in the lowercase
    string then it is displayed in dark blue.
    >
    Can someone explain why this is, and what the difference between these
    two versions of string is please.
    >

    Comment

    • Lebesgue

      #3
      Re: difference between String and string

      string is a C# language keyword. It's usage translates to System.String,
      which is the String you are referring to. These are absolutely he same in
      C#. You can also use the System.String constructors using "string" notation
      as follows: string s = new string('a', 10); or call the static methods of
      the System.String class using the "string" keyword.

      "CCLeasing" <gary@ccleasing .co.ukwrote in message
      news:1163154739 .290592.280310@ h54g2000cwb.goo glegroups.com.. .
      >I notice in my code that is String is typed with an uppercase S it is
      coloured light blue in the IDE and if it is typed in the lowercase
      string then it is displayed in dark blue.
      >
      Can someone explain why this is, and what the difference between these
      two versions of string is please.
      >

      Comment

      • CCLeasing

        #4
        Re: difference between String and string

        Thankyou

        Comment

        Working...