|
Description Syntax Return
Datatype Example Migration
InStrRev Function - Visual Basic
6.0 (VB 6.0) |
Returns the position of the first occurrence of one
string within another, from the end of string. |
|
Syntax: |
InStrRev(stringcheck, stringmatch[,
start[, compare]])
Parameter |
Description |
stringcheck |
Required. String expression being searched. |
stringmatch |
Required. String expression searched for. |
start |
Optional. Numeric expression that sets the starting position
for each search. Default -1. |
compare |
Optional. Numeric value indicating the kind of comparison
to use when evaluating substrings. |
InStrRev Function's compare argument:
Constants |
Value |
Description |
vbUseCompareOption |
-1 |
Performs a comparison using the setting of the Option Compare
statement. |
vbBinaryCompare |
0 |
Default. Perform a binary comparison. |
vbTextCompare |
1 |
Perform a textual comparison. |
vbDatabaseCompare |
2 |
Microsoft Access only. Performs a comparison based on information
in your database. |
|
|
Return Data type: |
|
Long |
Example: |
Dim SearchStr as String, SearchChar as String
SearchStr = "Chennaiiq"
SearchChar = "N"
Statement |
Result |
Remark |
InStrRev(SearchStr, SearchChar, -1, 1) |
5 |
vbTextCompare |
|
InStrRev(SearchStr, SearchChar, -1, 0) |
0 |
vbBinaryCompare |
|
InStrRev(SearchStr, SearchChar, 4, 1) |
4 |
Second occurrence (Reverse) |
|
InStrRev(SearchStr, SearchChar, 6, 1) |
0 |
|
|
InStrRev(SearchStr, LCase(SearchChar)) |
5 |
|
|
InStrRev("", SearchChar) |
0 |
|
|
InStrRev(SearchStr, "") |
9 |
Length of Stringcheck |
|
InStrRev(Null, SearchChar) |
Error |
Invalid use of null |
|
InStrRev(SearchStr, Null) |
Error |
Invalid use of null |
 |
|
|
Migration from Visual Basic 6.0 (VB 6.0) to |
|
InStrRev Function in VB Script (VBS) |
|
InStrRev Function in JScript (JS) |
|
InStrRev Function in ASP (Active Server Page) |
|
InStrRev Function in PHP Script |
|
InStrRev Function in MS-Access |
|
InStrRev Function in MS SQL Server |
|
InStrRev Function in Oracle |
|
InStrRev Function in C Language |
|
InStrRev Function in C++ Language |
|
InStrRev Function in Foxpro |
|
InStrRev Function in Fortran |
|
InStrRev Function in MS Excel Sheet |
 |
|
|
|
|