Thiyagarajan E
What is the difference between string and String in c#?
By Thiyagarajan E in .NET on Nov 08 2018
  • Vipin Soni
    Nov, 2018 14

    " System.String " a.k.a "String" ( capital "S") is a .NET framework data type while "string" is a C# data type. In short "String" is an alias ( the same thing called with different names) of "string". So technically both the below code statements will give the same output.

    • 3
  • srinivas rao
    Sep, 2019 3

    “string” is a datatype, whereas “String” represents a class. “string” is an alias for System.String. At execution time both are compiled to the same code. One more difference is the syntax highlighter

    • 2
  • Salman Beg
    Jan, 2019 19

    We can say both the string and String are same. Even if we can also say string is an alias name of String. But when we use String then we Should include "using System" Namespace otherwise it will generate an Error.Whenever, we hover the mouse on both string and String then it will Show that it comes under System namespace.

    • 2
  • Rashmiranjan Dalabehera
    Nov, 2018 15

    string is an alias for the String class in .NET framework

    • 2
  • Ishoo Anyal
    Sep, 2019 27

    string is alias to String class nothing more nothing less.
    Which is a sealed class

    • 0
  • Bidyasagar Mishra
    Aug, 2019 4

    string is a reserved word, but String is just a class name.

    • 0
  • Md Sarfaraj
    Feb, 2019 18

    String is an object But string is a variable

    • 0
  • Md Sarfaraj
    Jan, 2019 25

    String is a object and string is a variable

    • 0
  • Mukesh Kumar
    Jan, 2019 25

    String is class while string is structure

    • 0
  • Sneha Reddy
    Dec, 2018 20

    In C#, string is an alias for the String class in .NET framework.

    • 0
  • Sreekanth Reddy
    Nov, 2018 25

    Both results same.

    • 0
  • Naveen Bisht
    Nov, 2018 19

    Technically no difference, further please flow below link.

    • 0

Most Popular Job Functions