Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Copy a string with clone option in C#

You can make use of clone() function for copying a string to another string.

  1. using System;
  2. using System.IO;
  3. using System.Text;
  4.  
  5. namespace forgetCode
  6. {
  7. class program1
  8. {
  9. static void Main(string[] args)
  10. {
  11. string firstString = "Forget code";
  12. string baby = firstString.Clone().ToString();
  13. Console.WriteLine(baby);
  14. }
  15. }
  16. }


Output:
Forget code

..