Mega Code Archive

 
Categories / C# / Data Types
 

String copy

/* Learning C#  by Jesse Liberty Publisher: O'Reilly  ISBN: 0596003765 */  using System;  namespace StringManipulation  {     public class TesterStringManipulationCopy     {        public void Run()        {            string s1 = "abcd";            string s2 = "ABCD";            // the string copy method            string s5 = string.Copy(s2);            Console.WriteLine(                "s5 copied from s2: {0}", s5);            // use the overloaded operator            string s6 = s5;            Console.WriteLine("s6 = s5: {0}", s6);        }        static void Main()        {           TesterStringManipulationCopy t = new TesterStringManipulationCopy();           t.Run();        }     }  }