I have an array of int containing some values starting from index 0. I want to swap two values for example value of index 0 should be swapped with the value of index 1. How
You could create an extension method that would work for any array
public static void SwapValues(this T[] source, long index1, long index2) { T temp = source[index1]; source[index1] = source[index2]; source[index2] = temp; }