please help me. I would like get a part of array by mask array. This is my code:
byte[] source = new byte[] {97, 98, 99, 5, 15, 66, 77, 102, 0, 102, 0, 102, 0, 102, 0, 102, 0};
byte[] mask = new byte[] { 102, 0, 102, 0, 102, 0, 102, 0 };
byte[] result = EscapeArray(0, source, mask);
private byte[] EscapeArray(int startIndex, byte[] source, byte[]mask)
{
???
}
Output from EscapeArray method will be 97, 98, 99, 5,15, 66, 77. Source array has any values but somewhere is mask sequence. EscapeArray returns part of array from startIndex to start of mask. I need very fast algorithm because this method will be carried out very often. Thanks