+92 332 4229 857 99ProjectIdeas@Gmail.com

String Copy Function (C#.net)





Creates a new instance of String with same value as specified.





For example:
     string strOne = "Maverick";
            string newStr = string.Copy(strOne);
            MessageBox.Show(newStr);
   Output:
            Maverick (Because it copies that strOne value to newStr)

See if reference are equals:
             
           MessageBox.Show(object.ReferenceEquals(strOne,newStr).ToString());

   Output:
           False (Because both strings have different references)

0 comments: