How to use Copy() to copy a string to other string in C#

1 Answer

0 votes
using System;
using System.Collections.Generic;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = "c# modern programming";

            string s2 = string.Copy(s1);

            Console.WriteLine(s1);
            Console.WriteLine(s2);
        }
    }
}


/*
run:
     
c# modern programming
c# modern programming
 
*/

 



answered Dec 22, 2016 by avibootz
...