Tartalom

# InStrRev függvény [VBA]

Returns the position of a string within another string, starting from the right side of the string.

This constant, function or object is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.

The InStrRev function returns the position at which the match was found, from the right. If the string was not found, the function returns 0.

### Szintaxis:

    InStrRev (StringCheck As String, StringMatch As String [,Start As Long] [, Compare As Integer])

### Return type:

Long

### Paraméterek:

StringCheck: The string expression that you want to search.

StringMatch: The string expression that you want to search for.

Kezdés: Opcionális numerikus kifejezés, amely a keresendő részkarakterlánc keresésének balról számított kezdési pozícióját jelzi. Ha ez a paraméter nincs megadva, a keresés a karakterlánc végétől kezdődik. A maximális érték 65535.

Compare: Optional numeric expression that defines the type of comparison. The value of this parameter can be

1: The default value of 1 specifies a text comparison that is not case-sensitive.

0: The value of 0 specifies a binary comparison that is case-sensitive.

To avoid a run-time error, do not set the Compare parameter if the first return parameter is omitted.

### Hibakódok:

5 Érvénytelen eljáráshívás

### Példa:

    Sub ExamplePosition
    Dim sInput As String
    Dim iPos As Integer
     sInput = "The book is on the table"
     iPos = InStrRev(sInput,"the",10,1) ' Returns 1, search is case-insensitive
     Print iPos
     iPos = InStrRev(sInput,"the",10,0) ' Returns 0, search is case-sensitive
     Print iPos
    End Sub

Kapcsolódó témakörök

InStr

Támogasson minket!