locked
What's the difference between string and System.String? RRS feed

  • Question

  • What's the difference between string and System.String?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, April 9, 2009 7:23 AM

Answers

  • C# defines a number of aliases for CLR types. They may be used interchangeably, and even mixed together, e.g. string x = new System.String(' ', 5);. These are the aliases defined:

    Alias

    CLR type

    string

    System.String

    sbyte

    System.SByte

    byte

    System.Byte

    short

    System.Int16

    ushort

    System.UInt16

    int

    System.Int32

    uint

    System.UInt32

    long

    System.Int64

    ulong

    System.UInt64

    char

    System.Char

    float

    System.Single

    double

    System.Double

    bool

    System.Boolean

    decimal

    System.Decimal

     

    For more FAQ about Visual C# General, please see Visual C# General FAQ

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, April 9, 2009 7:23 AM

All replies

  • C# defines a number of aliases for CLR types. They may be used interchangeably, and even mixed together, e.g. string x = new System.String(' ', 5);. These are the aliases defined:

    Alias

    CLR type

    string

    System.String

    sbyte

    System.SByte

    byte

    System.Byte

    short

    System.Int16

    ushort

    System.UInt16

    int

    System.Int32

    uint

    System.UInt32

    long

    System.Int64

    ulong

    System.UInt64

    char

    System.Char

    float

    System.Single

    double

    System.Double

    bool

    System.Boolean

    decimal

    System.Decimal

     

    For more FAQ about Visual C# General, please see Visual C# General FAQ

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, April 9, 2009 7:23 AM
  • Hey,
    How are you? Why you are asking questions to yourself? :D
    I mean mark that as discussion or something ... or you want to make some points ;p
    Adil Mughal - MCP http://adilamughal.blogspot.com
    Thursday, April 9, 2009 8:31 AM
  • What's the difference between string and System.String?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    A man from MSFT asks What's the difference between string and System.String?

    Was is das?
    Best regards, Sergiu
    Thursday, April 9, 2009 8:40 AM
  • Hello all,

    Please understand that this thread is one of the C# General FAQs.  

    For more C# General FAQ, please see
    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/2d666562-ed08-4461-bf92-7808913b4e96

     

    Best Regards,
    Lingzhi


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, April 10, 2009 6:05 AM
    Moderator