Hunny Software Library Reference

ByteString.IndexOf Method (ByteString, Int32, Int32)

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

[Visual Basic]
Overloads Public Function IndexOf( _
   ByVal str As ByteString, _
   ByVal startIndex As Integer, _
   ByVal count As Integer _
) As Integer
[C#]
public int IndexOf(
   ByteString str,
   int startIndex,
   int count
);

Parameters

str
the ByteString to seek
startIndex
starting position of the search
count
number of positions to examine

Return Value

position in this instance where str was found;
or startIndex if str is empty;
or -1 if str is not found

Remarks

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

The search is case-sensitive.

Exceptions

Exception TypeCondition
ArgumentNullExceptionstr is null
ArgumentOutOfRangeExceptionstartIndex < 0;
or count < 0;
or startIndex + count > Length

See Also

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