$SubErs: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(39 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$SubErs}}
{{DISPLAYTITLE:$SubErs}}
<span class="pageSubtitle"><section begin="desc" />Remove occurrence of one string from another<section end="desc" /></span>
<span class="pageSubtitle">Remove occurrence of one string from another</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubErs function is [[to be entered]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubErs function is the <var>[[Remove (String function)|Remove]]</var> function.</p>


This function removes an occurrence of one string from another.  
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 <var>$SubErs</var> function accepts four arguments and returns a string result that is part of the first argument string.  


The first argument is an arbitrary string.  
==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>
 
===Syntax terms===
<table>
<tr><th>%string</th>
<td>The part of the <var class="term">string</var> argument that remains after <var class="term">substring</var> is removed from it.</td></tr>
 
<tr><th>string</th>
<td>An arbitrary string.</td></tr>


The second argument is another arbitrary string.  
<tr><th>substring</th>
<td>Another arbitrary string. </td></tr>


The third argument is a starting position in the first argument string.  
<tr><th>start_pos</th>
<td>A starting position within <var class="term">string</var>. </td></tr>


The fourth argument is a repeat count indicating the number of occurrences to be removed. This is an optional argument and defaults to 1.
<tr><th>count</th>
==Syntax==
<td>A repeat count indicating the number of occurrences of <var class="term">substring</var> to be removed. This is an optional argument, and it defaults to 1.</td></tr>  
<p class="syntax"><section begin="syntax" /> %STRING = $SubErs(string, substring, start_pos, count)
</table>
<section end="syntax" /></p>
<p class="caption">$SubErs Function
</p>
<p class="caption">%STRING is part of the first argument string.</p>


==Examples==
<ol>
<li>This statement sets %JUNK to <tt>CDABAB</tt>:


For example, this statement sets %JUNK to <tt>CDABAB</tt>:
<p class="code">%JUNK = $SubErs('ABCDABAB', 'AB')
<p class="code"> %JUNK = $SubErs('ABCDABAB', 'AB')
</p>
</p>


<li>This statement sets %JUNK to <tt>WE WAITED LONG ENOUGH</tt>:


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>


<li>This statement sets %JUNK to <tt>WE HAVE AITED LONG ENOUGH</tt>:


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>


<li>This statement sets %JUNK to <tt>E HAVE AITED LONG ENOUGH</tt>:


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}}==
<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>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $SubErs
</p>




[[Category:$Functions|$SubErs]]
[[Category:$Functions|$SubErs]]

Latest revision as of 23:29, 20 September 2018

Remove occurrence of one string from another

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubErs function is the Remove 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.

Syntax

%string = $SubErs(string, substring, start_pos, [count])

Syntax terms

%string The part of the string argument that remains after substring is removed from it.
string An arbitrary string.
substring Another arbitrary string.
start_pos A starting position within string.
count A repeat count indicating the number of occurrences of substring to be removed. This is an optional argument, and it defaults to 1.

Examples

  1. This statement sets %JUNK to CDABAB:

    %JUNK = $SubErs('ABCDABAB', 'AB')

  2. This statement sets %JUNK to WE WAITED LONG ENOUGH:

    %JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'HAVE ')

  3. This statement sets %JUNK to WE HAVE AITED LONG ENOUGH:

    %JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'W', 5)

  4. This statement sets %JUNK to E HAVE AITED LONG ENOUGH:

    %JUNK = $SubErs('WE HAVE WAITED LONG ENOUGH', 'W', 1, 5)

Products authorizing $SubErs