$SubErs

From m204wiki
Revision as of 17:36, 28 January 2011 by 198.242.244.47 (talk) (Created page with "{{DISPLAYTITLE:$SubErs}} <span class="pageSubtitle"><section begin="desc" />Remove occurrence of one string from another<section end="desc" /></span> <p class="warning">Most Sir...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<section begin="desc" />Remove occurrence of one string from another<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubErs function is to be entered.

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

<section begin="syntax" /> %STRING = $SubErs(string, substring, start_pos, count) <section end="syntax" />

$SubErs Function

%STRING is part of the first argument string.


For example, 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