Hunny Software Library Reference

ByteString.IndexOf Method (Byte, Int32, Int32)

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

[Visual Basic]
Overloads Public Function IndexOf( _
   ByVal by As Byte, _
   ByVal startIndex As Integer, _
   ByVal count As Integer _
) As Integer
[C#]
public int IndexOf(
   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

Index numbering starts from zero.

The search starts at position startIndex. At most count positions are examined.

Exceptions

Exception TypeCondition
ArgumentOutOfRangeExceptionstartIndex < 0;
count < 0;
startIndex + count > Length

See Also

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