I have 2 byte arrays:
Dim A() As Byte = {1, 2, 3, 4, 5, 6, 7, 8, 9}
Dim B() As Byte = {5, 6, 7}
Now I want to find the occurance of the full B in A. I tried Array.IndexOf(A, B) with no luck. Is there a simple way to search an array by array without the need to use any loops?
It should find the index (position) of 5,6,7 in the same order as in B().
If A() contains {1,2,3,4,7,6,5,9} it should return false or -1 because they are not in the same order.
The following Linq statement will give an
IEnumerable<int>containing the positions of b in a (or an empty set if none occur):I have no idea how to translate to VB.NET.