How to trim few bytes of a byte array?

This is not the most efficient thing, but will do the trick: long array = ...; long newArray = array. Skip(16).ToArray().

I have tried that but VS said skip is not member of array. Why? – NewBie Sep 22 at 8:40 @NewBie because you didn't have a using System.

Linq in the top of the file. SKip is an extension method and not a member of array. The actual error message should say something like "...not an member of and could not find an extension method taking a sometype as it's first argument" – Rune FS Sep 22 at 8:44 Wow, LINQ is so convenient!Thanks.

– NewBie Sep 22 at 8:47.

Check out Array. Copy For example: var array = //initialization int bytesToEliminate = 16; int newLength = array. Length - bytesToEliminate; //you may need to check if this positive var newArray = new bytenewLength; Array.

Copy(array, bytesToEliminate, newArray, 0, newLength).

I checked that and failed to eliminate first 16 byte. PLease help – NewBie Sep 22 at 8:28 Array. Copy will not alter the original array, but it will create a copy.

Used correctly that copy will have trimmed of the first 16 bytes. – Arjan Einbu Sep 22 at 8:34 @NewBie - I made an update to answer with a short example. Anyway, you should read MSDN article to understand how to use it.

– MAKKAM Sep 22 at 8:38.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions