Difference between string.Empty and String.Empty in C#

This question already has an answer here:

  • What is the difference between String and string in C#? 59 answers

  • It is the same. string is an alias of class System.String .

    some common aliases:

    object  ==>  System.Object
    string  ==>  System.String
    bool    ==>  System.Boolean
    int     ==>  System.Int32
    float   ==>  System.Single
    double  ==>  System.Double
    decimal ==>  System.Decimal
    char    ==>  System.Char
    

    String.Empty and string.Empty are same. String is the BCL class name. string is the C#...shortcut if you will. Same as with Int32 and int.


    Both are SAME except that string is treated as a keyword with Blue color (default) and System.String is a Class with Green Color (default) in the VS editor.

    Underlying implementation are all the same. In other words points to the same.

    链接地址: http://www.djcxy.com/p/3602.html

    上一篇: 在C#中Int64和long有什么区别?

    下一篇: 在C#中string.Empty和String.Empty之间的区别