$SubErs: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
Line 2: Line 2:
<span class="pageSubtitle">Remove occurrence of one string from another</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 the [[Remove (String function)]].</p>
<p class="warn"><b>Note: </b>Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubErs function is the [[Remove (String function)]].</p>


This function removes an occurrence of one string from another.  
This function removes an occurrence of one string from another.  

Revision as of 18:59, 19 July 2013

Remove occurrence of one string from another

Note: 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

  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