$Lstr Windex: Difference between revisions
(Automatically generated page update) |
(Automatically generated page update) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Return the position of a word within a long string</span> | <span class="pageSubtitle">Return the position of a word within a long string</span> | ||
<p class="warn"><b>Note: </b> | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for $Lstr_Windex is <var>[[WordNumberIn (String function)|WordNumberIn]]</var>. Or, you may find the features of the [[StringTokenizer class|StringTokenizer]] to be more helpful.</p> | ||
This function takes a string or longstring input and returns a number indicating the word position of the second argument within the long string. If the word is not present, zero is returned. | This function takes a string or longstring input and returns a number indicating the word position of the second argument within the long string. If the word is not present, zero is returned. | ||
Line 45: | Line 45: | ||
<li>[[List of $functions|Sirius functions]]</li> | <li>[[List of $functions|Sirius functions]]</li> | ||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> | ||
<li>[ | <li>[[Media:JoclrNew.pdf|Janus Open Client]]</li> | ||
<li>[ | <li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li> | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li>Japanese functions</li> | <li>Japanese functions</li> | ||
<li>[ | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
</p> | </p> |
Latest revision as of 22:52, 20 September 2018
Return the position of a word within a long string
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for $Lstr_Windex is WordNumberIn. Or, you may find the features of the StringTokenizer to be more helpful.
This function takes a string or longstring input and returns a number indicating the word position of the second argument within the long string. If the word is not present, zero is returned.
The $Lstr_Windex function accepts three arguments and returns a string result.
The first argument is an arbitrary string or longstring. This is a required argument.
The second argument is an arbitrary string containing a single word. The word must have no occurrences of any of the delimiters in argument three, and may not be null. This is a required argument.
The third argument is a string containing from 1 to 255 characters which are the delimiters for the longstring. This is an optional argument and defaults to a blank.
Syntax
%result = $Lstr_Windex(longstring, word, delims)
%result is the position of word within longstring.
Examples
- To set %RES to "6":
%RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea')
- To set %RES to "3":
%RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea', '- ')
See also
- Word - Select word from list of words
- Words - Sublist of list of words
- WordCount - Count words in list
- WordNumberIn and WordNumberOf - Word number of "needle" word within "haystack" list of words
Products authorizing $Lstr_Windex
- Sirius functions
- Fast/Unload User Language Interface
- Janus Open Client
- Janus Open Server
- Janus Sockets
- Janus Web Server
- Japanese functions
- Sir2000 Field Migration Facility