Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ Ctor() [1/9]

unsafe string System.String.Ctor ( char * ptr)
inlineprivate

Definition at line 953 of file String.cs.

954 {
955 if (ptr == null)
956 {
957 return Empty;
958 }
959 int num = wcslen(ptr);
960 if (num == 0)
961 {
962 return Empty;
963 }
964 string text = FastAllocateString(num);
965 nuint elementCount = (uint)text.Length;
966 Buffer.Memmove(ref text._firstChar, ref *ptr, elementCount);
967 return text;
968 }
static readonly string Empty
Definition String.cs:29
static unsafe int wcslen(char *ptr)
Definition String.cs:1417
static string FastAllocateString(int length)

References System.String.Empty, System.String.FastAllocateString(), System.Buffer.Memmove(), System.text, and System.String.wcslen().