This documentation is archived and is not being maintained.
String Constructor (array<Char>)
Visual Studio 2010
Initializes a new instance of the String class to the value indicated by an array of Unicode characters.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- value
- Type: array<System::Char>
An array of Unicode characters.
The following simple example demonstrates how you can create an instance of the String class with this constructor.
// Unicode Mathematical operators wchar_t charArray1[4] = {L'\x2200',L'\x2202',L'\x200F',L'\x2205'}; wchar_t * lptstr1 = &charArray1[ 0 ]; String^ wszMathSymbols = gcnew String( lptstr1 ); // Unicode Letterlike Symbols wchar_t charArray2[4] = {L'\x2111',L'\x2118',L'\x2122',L'\x2126'}; wchar_t * lptstr2 = &charArray2[ 0 ]; String^ wszLetterLike = gcnew String( lptstr2 ); // Compare Strings - the result is false Console::WriteLine( String::Concat( L"The Strings are equal? ", (0 == String::Compare( wszLetterLike, wszMathSymbols ) ? (String^)"TRUE" : "FALSE") ) );
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: