$SubErs: Difference between revisions
(Automatically generated page update) |
m (→Syntax) |
||
Line 17: | Line 17: | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"><span class="term">%STRING</span> = <span class="literal">$SubErs</span>(<span class="term">string</span>, <span class="term">substring</span>, <span class="term">start_pos</span>, <span class="term">count</span>) | <p class="syntax"><span class="term">%STRING</span> = <span class="literal">$SubErs</span>(<span class="term">string</span>, <span class="term">substring</span>, <span class="term">start_pos</span>, [<span class="term">count</span>]) | ||
</p> | </p> | ||
<p>%STRING is part of the first argument string.</p> | <p>%STRING is part of the first argument string.</p> | ||
==Examples== | |||
<ol> | |||
<li>This statement sets %JUNK to <tt>CDABAB</tt>: | |||
<p class="code"> %JUNK = $SubErs('ABCDABAB', 'AB') | <p class="code">%JUNK = $SubErs('ABCDABAB', 'AB') | ||
</p> | </p> | ||
This statement sets %JUNK to <tt>WE WAITED LONG ENOUGH</tt>: | <li>This statement sets %JUNK to <tt>WE WAITED LONG ENOUGH</tt>: | ||
<p class="code"> %JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'HAVE ') | <p class="code">%JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'HAVE ') | ||
</p> | </p> | ||
This statement sets %JUNK to <tt>WE HAVE AITED LONG ENOUGH</tt>: | <li>This statement sets %JUNK to <tt>WE HAVE AITED LONG ENOUGH</tt>: | ||
<p class="code"> %JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'W', 5) | <p class="code">%JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'W', 5) | ||
</p> | </p> | ||
This statement sets %JUNK to <tt>E HAVE AITED LONG ENOUGH</tt>: | <li>This statement sets %JUNK to <tt>E HAVE AITED LONG ENOUGH</tt>: | ||
<p class="code"> %JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'W', 1, 5) | <p class="code">%JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'W', 1, 5) | ||
</p> | </p> | ||
</ol> | |||
==Products authorizing {{PAGENAMEE}}== | ==Products authorizing {{PAGENAMEE}}== |
Revision as of 02:40, 16 April 2013
Remove occurrence of one string from another
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubErs function is the Remove (String function).
This function removes an occurrence of one string from another.
The $SubErs function accepts four arguments and returns a string result that is part of the first argument string.
The first argument is an arbitrary string.
The second argument is another arbitrary string.
The third argument is a starting position in the first argument string.
The fourth argument is a repeat count indicating the number of occurrences to be removed. This is an optional argument and defaults to 1.
Syntax
%STRING = $SubErs(string, substring, start_pos, [count])
%STRING is part of the first argument string.
Examples
- This statement sets %JUNK to CDABAB:
%JUNK = $SubErs('ABCDABAB', 'AB')
- This statement sets %JUNK to WE WAITED LONG ENOUGH:
%JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'HAVE ')
- This statement sets %JUNK to WE HAVE AITED LONG ENOUGH:
%JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'W', 5)
- This statement sets %JUNK to E HAVE AITED LONG ENOUGH:
%JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'W', 1, 5)
Products authorizing $SubErs
- Sirius functions
- Fast/Unload User Language Interface
- Janus Open Client
- Janus Open Server
- Janus Sockets
- Janus Web Server
- Japanese functions
- Sir2000 Field Migration Facility