3
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by pritesh2010
0
Sub Main()
		Dim aByte() As Byte = Text.Encoding.Default.GetBytes("FirstString")
		Dim bByte() As Byte = Text.Encoding.Default.GetBytes("SecondString")
		Dim mergedByte(aByte.Length + bByte.Length) As Byte
		aByte.CopyTo(mergedByte, 0)
		bByte.CopyTo(mergedByte, aByte.Length)
		Console.WriteLine(System.Text.Encoding.Default.GetString(mergedByte))
		Console.Read()
    End Sub
0

this can be done through Array List Objects. see here

byte[] byteArray1 = new byte[5];
byte[] byteArray2 = new byte[11];
byte[] combined = new byte[byteArray1.Length + byteArray2.Length];
byteArray1.CopyTo(combined, 0);
Array.Copy(byteArray2, 0, combined, byteArray1.Length,
byteArray2.Length);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.