Skip to content

Instantly share code, notes, and snippets.

@Torxed
Created November 15, 2016 14:07
Show Gist options
  • Save Torxed/ee0ebb358fcd772bb3f3589251f3df5a to your computer and use it in GitHub Desktop.
Save Torxed/ee0ebb358fcd772bb3f3589251f3df5a to your computer and use it in GitHub Desktop.
test.c
public static T[] RemoveAt<T>(this T[] source, int index)
{
T[] dest = new T[source.Length - 1];
if( index > 0 )
Array.Copy(source, 0, dest, 0, index);
if( index < source.Length - 1 )
Array.Copy(source, index + 1, dest, index, source.Length - index - 1);
return dest;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment