[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
REPLALL()
Exchanges particular characters at the beginning and end of a string
------------------------------------------------------------------------------
Syntax
REPLALL(<cString>,<cReplacecharacter|
nReplacecharacter>,[<cSearchCharacter|
nSearchCharacter>]) --> cString
Arguments
<cString> [@] Designates the string that is processed.
<cReplacecharacter|nReplacecharacter> Designates the character that
replaces the character in <cSearchCharacter|nSearchCharacter> at the
beginning and end of <cString>.
<cSearchCharacter|nSearchCharacter> Designates the character at the
beginning and end of <cString> that is replaced by <cReplacecharacter|
nReplacecharacter>. The default value designates a space, CHR(32).
Returns
The processed <cString> is returned.
Description
REPLALL() can be used to exchange all leading and trailing spaces in a
character string for any other character. Notice that the first non-
replaceable character in either direction causes REPLALL() to stop
replacing characters on that side.
Note
. The return value of this function can be suppressed by
implementing CSETREF() to save space in working memory.
Examples
. Replace spaces with dashes. Replace the spaces only on the
side where the character was found:
? REPLALL("abcd ", "-") // "abcd--"
. Replace zeros with spaces:
? REPLALL("001234", " ", "0") // " 1234"
. Replace the blanks with dashes on both sides:
? REPLALL(" d ", "-") // "---d--"
. Replace only continuous sequences of characters at the
beginning and the end of the character string:
? REPLALL(" d d ", "-") // "-d d--"
See Also:
REPLLEFT()
REPLRIGHT()
CSETREF()
Introduction
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson