例 次の例では、値が等しい 3 つの文字列を使用して、新しく作成された文字列とインターン文字列が等しいかどうかを判断します。 // Sample for String::Intern(String) using namespace System; using namespace System::Text; int main() { String^ s1 = "MyTest"; String^ s2 = (gcnew StringBuilder)->Append( "My" )->Append( "Test" )->ToString(); String^ s3 = String::Intern( s2 ); Console::WriteLine( "s1 == '{0}'", s1 ); Console::WriteLine( "s2 == '{0}'", s2 ); Console::Wr