Essential C# Built-in Types  Suggest an edit

Immutable reference type - string

// assign string from a string literal
string s = "hello";

// assign string from an array of characters
char[] chars = new char[] { 'h', 'e', 'l', 'l', 'o' };
string s = new string(chars, 0, chars.Length);

// assign string from a char pointer, derived from a string
string s;
unsafe
{
    fixed (char* charPointer = "hello")
    {
        s = new string(charPointer);
    }
}


Table Of Contents
22 Enum
25 GUID
32 Built-in Types
107 Stream
108 Timers
  ↑ ↓ to navigate     ↵ to select     Esc to close