I think to remove an element of an
array
other elements have to be
shifted
and the array has to be resized using
Array.Resize
method explained here
http://msdn.microsoft.com/en-us/library/bb348051.aspx[
^] at which it is mentioned that
This method allocates a new array with the specified size, copies elements from the old array to the new one, and then replaces the old array with the new one.
Alternatively, since the string class represents contiguous elements of a
character array
, its
Remove
method explained here
http://msdn.microsoft.com/en-us/library/d8d7z2kk.aspx[
^] can be used as follows:
char[] chars = new char[]{'c','h','a','r','s'};
char[] trimmedChars = new string(chars).Remove(1,1).ToCharArray();