Hunny Software Library Reference

ByteString.LastIndexOfAny Method (Byte[], Int32, Int32)

Reports the index of the last occurrence in this instance of any byte in a specified array of bytes.

[Visual Basic]
Overloads Public Function LastIndexOfAny( _
   ByVal anyOf As Byte(), _
   ByVal startIndex As Integer, _
   ByVal count As Integer _
) As Integer
[C#]
public int LastIndexOfAny(
   byte[] anyOf,
   int startIndex,
   int count
);

Parameters

anyOf
byte array containing the set of bytes to seek
startIndex
starting position of the search
count
number of positions to examine

Return Value

largest index less than or equal to startIndex and greater than startIndex - count where any byte in anyOf was found;
-1 if no byte in anyOf was found

Remarks

The search begins at startIndex and continues to - count + 1. The position startIndex - count is not included in the search.

Exceptions

Exception TypeCondition
ArgumentNullExceptionanyOf is null
ArgumentOutOfRangeExceptionstartIndex < 0;
or count < 0;
or startIndex > Length;
or startIndex - count < 0

See Also

ByteString Class | Hunny.Base Namespace | ByteString.LastIndexOfAny Overload List