Returns the position of the first occurrence of one string within another, starting from the right side of the string.
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
public static function InStrRev( StringCheck : String, StringMatch : String, Start : int, Compare : CompareMethod ) : int
- Type: System.String
Required. String expression being searched.
- Type: System.String
Required. String expression being searched for.
- Type: System.Int32
Optional. Numeric expression setting the one-based starting position for each search, starting from the left side of the string. If Start is omitted then –1 is used, meaning the search begins at the last character position. Search then proceeds from right to left.
- Type: Microsoft.VisualBasic.CompareMethod
Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. If omitted, a binary comparison is performed. See Settings for values.
Return ValueType: System.Int32
If StringCheck is zero-length, InStrRev returns 0. If StringMatch is zero-length, InStrRev returns Start. If StringMatch is not found, InStrRev returns 0. If StringMatch is found within StringCheck, InStrRev returns position at which the first match is found, starting with the right side of the string. If Start is greater than length of StringMatch, InStrRev returns 0.
For more detailed information, see the Visual Basic topic InStrRev Function (Visual Basic).
Note that the syntax for the InStrRev function is not the same as the syntax for the InStr function.
The Compare argument can have the following values.
Performs a binary comparison.
Performs a textual comparison.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.