Export (0) Print
Expand All

String Constructor (Char*)

.NET Framework 1.1

Initializes a new instance of the String class to the value indicated by a specified pointer to an array of Unicode characters.

This constructor is not CLS-compliant. For more information about CLS compliance, see What is the Common Language Specification.

[C#]
[CLSCompliant(false)]
unsafe public String(
 char* value
);
[C++]
[CLSCompliant(false)]
public: String(
 __wchar_t* value
);

[Visual Basic] This constructor cannot be used in Visual Basic.

[JScript] This constructor cannot be used in JScript.

Parameters [C#, C++]

value
A pointer to a null terminated array of Unicode characters.

Remarks [C#, C++]

If value is a null pointer, an Empty instance is initialized.

This constructor copies the sequence of Unicode characters at the specified pointer until a null character (hexadecimal 0x00) is reached.

If the specified array is not null-terminated, the behavior of this constructor is system dependent. For example, such a situation might cause an access violation.

In C#, this constructor is defined only in the context of unmanaged code.

Requirements [C#, C++]

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

String Class | String Members | System Namespace | String Constructor Overload List | Char

Show:
© 2014 Microsoft