$Lstr Windex: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{DISPLAYTITLE:$Lstr_Windex}}
{{DISPLAYTITLE:$Lstr_Windex}}
<span class="pageSubtitle"><section begin="desc" />Return the position of a word within a long string<section end="desc" /></span>
<span class="pageSubtitle">Return the position of a word within a long string</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for <var>$Lstr_Windex</var> is <var>[[WordNumberIn (String function)|WordNumberIn]]</var>. Or, you may find the features of the [[StringTokenizer class|StringTokenizer]] to be more helpful.</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for <var>$Lstr_Windex</var> is <var>[[WordNumberIn (String function)|WordNumberIn]]</var>. Or, you may find the features of the [[StringTokenizer class|StringTokenizer]] to be more helpful.</p>

Revision as of 21:21, 22 November 2011

Return the position of a word within a long string

Most Sirius $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

<section begin="syntax" /> %RESULT = $Lstr_Windex(longstring, word, delims) <section end="syntax" />

$Lstr_Windex function

%RESULT is the position of word within longstring.

For example

%RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea')

sets %RES to "6" and

%RES = $Lstr_Windex('She sells sea-shells by the sea shore', 'sea', '- ')

sets %RES to "3".

$Lstr_Windex is only available in Sirius Mods Version 6.5 and later.

See also

Products authorizing $Lstr_Windex