Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

String::String Constructor

 

Initializes a new instance of the String class with a copy of the input string data.


String();

String(
  char16* s
)

String(
  char16* s, 
  unsigned int n
)

s

A series of wide characters that initialize the string. char16

n

A number that specifies the length of the string.

If performance is critical and you control the lifetime of the source string, you can use Platform::StringReference in place of String.

String^ s = L”Hello!”;

Requirements

Minimum supported client: Windows 8

Minimum supported server: Windows Server 2012

Namespace: Platform

Metadata: vccorlib.h

Show: