• Top Posts

    String Copy() method in C#


    • 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();  
         }  
       } 
    
    

    No comments

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728