Saturday, August 2.
  • Top Posts

    String Copy() method in C#

    ad728

    • The string copy() method returns the string object,which is same as original object but represents a different object reference.
    • To verify its reference,use assignment operation,which assigns an existing string reference to an additional object variable.
    • String copy() method derived from system.string
      class StringCopy  
       {  
         public static void Main(string[] args)  
         {  
           string str1 = "Test copy data";  
           string str2 = "Data";  
           str2 = string.Copy(str1);  
           Console.WriteLine(str2);  
           Console.ReadLine();  
         }  
       } 
    
    
    36

    No comments

    Post Top Ad

    Post Bottom Ad