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>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Etext | string | ||||
Eword | string |
Returns | |
---|---|
Type | Description |
integer | Returns the position which occupies the last idea of a word in a text, in an isolated way (does not find substrings, but the complet word). If you can not find it, return -1. |
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