$Lstr SubWord: Difference between revisions
Jump to navigation
Jump to search
(Automatically generated page update) |
(Automatically generated page update) |
||
Line 56: | Line 56: | ||
==Products authorizing {{PAGENAMEE}}== | ==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>[http://m204wiki.rocketsoftware.com/images/4/4a/JoclrNew.pdf Janus Open Client]</li> | <li>[http://m204wiki.rocketsoftware.com/images/4/4a/JoclrNew.pdf Janus Open Client]</li> |
Revision as of 22:08, 1 August 2014
Substring of a longstring using word counts
Note: Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for $Lstr_SubWord is Words. Or, you may find the features of the StringTokenizer to be more helpful.
This function takes a string or longstring input and produces a substring of the input using word counts.
The $Lstr_SubWord function accepts four arsguments and returns a longstring result.
Syntax
%result = $Lstr_SubWord(longstring, start, [words], [delim])
Syntax terms
%result | A substring of the input longstring. |
---|---|
longstring | An arbitrary string or longstring. This is a required argument |
start | A number between 1 and 2**31-1 that indicates the starting word number in the input string. This is a required argument. |
words | A number between 1 and 2**31-1 that indicates the length in words of the result string. This is an optional argument and defaults to the number of words left in the string. |
delim | 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. |
Usage notes
- Leading and trailing delimiters are removed from the resulting string, but all delimiters within the boundaries of the result are preserved.
Examples
- To set
%res
toa time
:%res = $Lstr_SubWord('Once upon a time you dressed so fine', 3, 2)
- To set
%res
toupon a
:%res = $Lstr_SubWord('Once upon a time you dressed so fine', 3, 2, ' n')
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