Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static T[] Reverse<T>(this T[] arr)
- {
- for (int i = 0, j = arr.Length - 1; i < arr.Length / 2; i++, j--)
- {
- T ph = arr[i];
- arr[i] = arr[j];
- arr[j] = ph;
- }
- return arr;
- }
Advertisement
Add Comment
Please, Sign In to add comment