String..::..IndexOf Method (String, Int32)
Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position.
Namespace:
SystemAssembly: Bridge (in Bridge.dll)
Syntax
[TemplateAttribute] public int IndexOf( string searchValue, int fromIndex )
<TemplateAttribute> _ Public Function IndexOf ( _ searchValue As String, _ fromIndex As Integer _ ) As Integer
[TemplateAttribute] public: int^ IndexOf( String^ searchValue, int^ fromIndex )
Return Value
The zero-based index position of value if that string is found, or -1 if it is not. If value is Empty, the return value is startIndex.Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | value is null. |
System..::..ArgumentOutOfRangeException | startIndex is less than 0 (zero) or greater than the length of this string. |