Q:

Write a C# Sharp program to move the first two characters to the end of a given string of length at least two

0

Write a C# Sharp program to move the first two characters to the end of a given string of length at least two.

Sample Output:

lloHe
JS

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;

namespace exercises
{
   class Program
    {       
        static void Main(string[] args)
        {
            Console.WriteLine(test("Hello"));
            Console.WriteLine(test("JS"));
            Console.ReadLine();
        }
        
         public static string test(string s1)
         {
              return s1.Remove(0, 2) + s1.Substring(0, 2);
         }
  }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now