Hunny Software Library Reference

ByteString.IndexOf Method (ByteString, 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 _
) As Integer
[C#]
public int IndexOf(
   ByteString str,
   int startIndex
);

Parameters

str
the ByteString to seek
startIndex
starting position of the search

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 the position specified by startIndex and continues until the last byte position.

The search is case-sensitive.

Exceptions

Exception TypeCondition
ArgumentNullExceptionstr is null
ArgumentOutOfRangeExceptionstartIndex < 0
or startIndex + str.Length > Length

See Also

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