I can't find any direct function (like mybytearray.copy(offset, count)) that select range of bytes from byte array. So, do I have to loop through to copy required bytes?
3 Answers
Dependent on what you exactly need, you might want to use LINQ. The syntax is self explaining :)
var newArr = currentArray.Skip(4).Take(300).ToArray();
3 Comments
VladL
@Chris_web what do you mean with "doesn't work"? If it doesn't compile, you should add using System.Linq; first :). Which .NET version do u use?
Chris_web
:) here my requirement is, from a 1024byte array, I have to copy 300bytes starting from 5th byte.