Clone a String in C#

In this article we will discuss about how to create clone a string in c#
  • 4039

The Clone method of string class is used to clone a string. The Clone method returns the reference of the same string. The following code snippet clones a string.

string firstName = "Mahesh";
string lastName = "Chand";
string authorName = firstName + " " + lastName ;
string cloneAuthor = authorName.Clone().ToString();


Ask Your Question 

Got a programming related question? You may want to post your question here


More Articles

© 2020 DotNetHeaven. All rights reserved.