if there are two array, first array size 100 bit and second array size 32 bit,i want to search 32 bit array in first array 100 bit
BitArray bits = new BitArray(100);
BitArray bitss = new BitArray(32);
bitss.Set(16,true);
bitss.Set(25,true);
bitss.Set(26,true);
bitss.Set(28,true);
bitss.Set(29,true);
bitss.Set(31,true);
for (int i = 0; i < (bits.Length)-1;i++ )
if ((bits[i] == bitss[0] &&
bits[i + 1] == bitss[1] &&
bits[i + 2] == bitss[2] &&
bits[i + 3] == bitss[3] &&
...
bits[i + 31] == bitss[31]))
Console.WriteLine("Found");
is there better method for search bitss array in bit array without use ( if and == ) in C#