$WBLINDOF - last index of

Availability
$WBLINDOF  is available for use with all WBSP commands:

Syntax
$WBLINDOF{texttobesearched|texttosearchfor|start}
$WBLINDOF[texttobesearched|texttosearchfor|start]

Parameters
texttobesearched - text being searched
texttosearchfor - text sought
start - optional numeric parameter specifying the position inside texttobesearched to begin search. If it does not exist, search begins at the end of the texttobesearched.

Returns
Number specifying position (from the beginning of the texttobesearched )  of first occurrence of texttosearchfor inside texttobesearched, starting from the end of texttobesearched or from start position, backwards.

Example

<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>WBLINDOF example</title>
</head>
<body>
The last occurrence of word in is at $WBLINDOF[The rain in Spain stays mainly in plains.| in ] position in sentence The rain in Spain stays mainly in plains.
</body>
</html>

After running this example, the resulting page in browser, may look like this:

The last occurrence of word in is at 31 position in sentence The rain in Spain stays mainly in plains.

Please note that there are two spaces around word in used as the second parameter of function $WBLINDOF. If you clear these spaces, function will return position 38, because last occurrence of string in (without spaces around it) is in word plains.