Any way to concatinate two byte arrays?

haseena

Member
Joined
Feb 3, 2016
Messages
9
Programming Experience
Beginner
Ma'm/Sir,

I need to concatinate two byte arrays. Can you give solution for this?
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,511
Location
Sydney, Australia
Programming Experience
10+
The old school way would be to call Array.Resize, or just create a new array of the new size, and then call Array.CopyTo. The most sensible way to do it these days would be to call Enumerable.Concat, e.g.
Dim newArray = firstArray.Concat(secondArray).ToArray()
 
Top Bottom