Athar Ali
What is the difference between String and string ?
By Athar Ali in ASP.NET on Nov 04 2008
  • Pavan Ramamurthy
    Aug, 2013 29

    string is keyword(blue color) string s = "C-SharpCorner.com"; Console.WriteLine(s); output: C-SharpCorner.com String is Class(Green color) String s = new String('A',5); Console.WriteLine(s); output: AAAAA prints the character 5 times

    • 0
  • Gohil Jayendrasinh
    Mar, 2009 16

    Both are premitive data type but 'string' is for C# and 'String' for .net framework

    • 0
  • Alan
    Nov, 2008 4

    There's no difference.

    The C# type 'string' is just an alias for the .NET type 'System.String'.

    So, as long as you include the following using directive in your program:

        using System;

    then 'string' and 'String' can be used interchangeably.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS