Hunny Software Library Reference

ByteString.LastIndexOf Method (Byte, Int32, Int32)

Reports the index of the last occurrence of the specified byte in this instance.

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

Parameters

by
a byte value to seek
startIndex
starting position of the search
count
number of positions to examine

Return Value

position in this instance where by was found;
-1 if by was not found

Remarks

The search ranges from startIndex to startIndex - count + 1. The byte at position startIndex - count is not examined.

Exceptions

Exception TypeCondition
ArgumentOutOfRangeExceptionstartIndex < 0;
count < 0;
startIndex - count < 0

See Also

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