Showing posts with label Swap Place in a Array C#. Show all posts
Showing posts with label Swap Place in a Array C#. Show all posts

Thursday 17 December 2015

Swap Place in a Array C#

  static void SwapPlace(string[] resultArray, int startPos, int endPos)
        {
            try
            {
                string tempswap;
                tempswap = resultArray[startPos];
                resultArray[startPos] = resultArray[endPos];
                resultArray[endPos] = tempswap;
            }
            catch
            {
                throw;
            }
        }