Given a string object and we have to create another instance of this object using String.Copy() method in C#.
String.Copy() Method
It is a method of String class which is used to create a new instance of String class copy value of already created String.
Syntax:
String String.Copy(String str);
Above method return newly created instance with value of passed string.
Example of String.Copy() in C#
Output
Here, we are declare a string object str1 and assigning the string value by reading from console, then we created another object of string str2 using String.Copy(), where str2 is the instance of str1 with the same value assigned in str1.