$Lstr Words: Difference between revisions
(Created page with "{{DISPLAYTITLE:$Lstr_Words}} <span class="pageSubtitle"><section begin="desc" />Return the number of words in a long string<section end="desc" /></span> <p class="warning">Most ...") |
(Automatically generated page update) |
||
(44 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Lstr_Words}} | {{DISPLAYTITLE:$Lstr_Words}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Return the number of words in a long string</span> | ||
<p class=" | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for $Lstr_Words is <var>[[WordCount (String function)|WordCount]]</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 | This function takes a string or longstring input and returns the number of words in the long string. | ||
The $Lstr_Words function accepts two arguments and returns a string result. | The <var>$Lstr_Words</var> function accepts two arguments and returns a string result. | ||
The first argument is an arbitrary string or longstring. This is a required argument. | The first argument is an arbitrary string or longstring. This is a required argument. | ||
The second 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. | The second 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== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%result</span> = $Lstr_Words(longstring, delims) | ||
</p> | </p> | ||
<p><var class="term">%result</var> is the count of words in the longstring.</p> | |||
</p> | ==Examples== | ||
<ol> | |||
<p class="code"> %RES = $Lstr_Words('Picture yourself in a boat on a river | <li>The following statement sets %RES to <code>8</code>: | ||
<p class="code">%RES = $Lstr_Words('Picture yourself in a boat on a river') | |||
</p> | </p> | ||
<li>This statement sets %RES to <code>7</code>: | |||
<p class="code">%RES = $Lstr_Words('Picture yourself in a boat on a river', 'a ') | |||
</p> | |||
</ol> | |||
==See also== | |||
<ul> | |||
<li><var>[[Word (String function)|Word]]</var> - Select word from list of words | |||
<li><var>[[Words (String function)|Words]]</var> - Sublist of list of words | |||
<li><var>[[WordCount (String function)|WordCount]]</var> - Count words in list | |||
<li><var>[[WordNumberIn and WordNumberOf (String functions)|WordNumberIn and WordNumberOf]]</var> - Word number of "needle" word within "haystack" list of words | |||
</ul> | |||
<p> | |||
==Products authorizing {{PAGENAMEE}}== | |||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
<li>[[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>[[Janus Open Client]]</li> | <li>[[Media:JoclrNew.pdf|Janus Open Client]]</li> | ||
<li>[[Janus Open Server]]</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> | <li>Japanese functions</li> | ||
<li>[[Sir2000 Field Migration Facility]]</li> | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | |||
</ul> | |||
</p> | </p> | ||
<p | <p> | ||
</p> | </p> | ||
[[Category:$Functions|$Lstr_Words]] | [[Category:$Functions|$Lstr_Words]] |
Latest revision as of 22:52, 20 September 2018
Return the number of words in a long string
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for $Lstr_Words is WordCount. Or, you may find the features of the StringTokenizer to be more helpful.
This function takes a string or longstring input and returns the number of words in the long string.
The $Lstr_Words function accepts two arguments and returns a string result.
The first argument is an arbitrary string or longstring. This is a required argument.
The second 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_Words(longstring, delims)
%result is the count of words in the longstring.
Examples
- The following statement sets %RES to
8
:%RES = $Lstr_Words('Picture yourself in a boat on a river')
- This statement sets %RES to
7
:%RES = $Lstr_Words('Picture yourself in a boat on a river', 'a ')
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_Words
- Sirius functions
- Fast/Unload User Language Interface
- Janus Open Client
- Janus Open Server
- Janus Sockets
- Janus Web Server
- Japanese functions
- Sir2000 Field Migration Facility