Returns the position of a word in a text or -1 if it does not find it.
1 string.find
<string.find>
<text /> !
<word /> !
</string.find>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Etext | string | Character string which will be repeated in the text. | |||
Eword | string | Number of times which the pattern, the text or the string are repeated. |
Returns | |
---|---|
Type | Description |
integer |
-1: Indicates that the word or substring has not been found within the text. >0: Indicates rhat the word or substring has been found within the text. This positive number is the position where it was found starting at 1. |
Exceptions
requires 2 arguments, received: ...
The 2 entry parameters has not been specified.
Example
Search of a string in a text string.
Copy
<xsql-script name='string_find'> <body> <set name='text'>This is a search test text</set> <set name='word'>test</set> <println> <string.find> <text/> <word/> </string.find> </println> </body> </xsql-script>
Returns:
Copy
17