We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

# how to add 2 byte array

on
Medium Priority
627 Views
how to add 2 byte array. ie
Dim b1() As System.Byte = {48, 48, 50, 49, 48, 49, 49, 48, 242, 56, 0, 1, 14, 192, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Dim b2() As System.Byte = Encoding.ASCII.GetBytes("02300110")
Comment
Watch Question

## View Solution Only

Commented:
Dim b3() As System.Byte
Dim b1() As System.Byte = {48, 48, 50, 49, 48, 49, 49, 48, 242, 56, 0, 1, 14, 192, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Dim b2() As System.Byte = System.Text.Encoding.ASCII.GetBytes("02300110")
If b1.Length > b2.Length Then
For i As Integer = 0 To b1.Length - 1
If b2.Length <= b1.Length Then
b3(i) = b1(i) + b2(i)
Else
b3(i) = b1(i)
End If
Next
Else
'b2>=b1.length
For i As Integer = 0 To b2.Length - 1
If b1.Length <= b2.Length Then
b3(i) = b1(i) + b2(i)
Else
b3(i) = b2(i)
End If
Next
End If

Not the solution you were looking for? Getting a personalized solution is easy.

##### Thanks for using Experts Exchange.

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile