Obtains the index of the last idea of a word in the text and returns its position.

1 string.lastIndexOfWord

<string.lastIndexOfWord>
    <text /> !
    <word /> !
</string.lastIndexOfWord>

Exceptions

requires 2 arguments, received: ...

The 2 entry parameters has not been specified.

Remarks

This function only obtains the text to search if is between spaces, this means if it if find in an isolated way in the text, otherwise returns -1.

Example

Obtains the index to a word in the text and returns its position.

Copy
<xsql-script name='string_lastIndexOfWord'>
    <body>
        <set name='text'>The students plays basketball in the stadium near the church</set>
        <set name='word'>de</set>
        <println>
            <string.lastIndexOfWord>
                <text /><word />
            </string.lastIndexOfWord>
        </println>
    </body>
</xsql-script>

Returns:

Copy
62