Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>strtran()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 STRTRAN()
 Search and replace characters within a character string or memo field
------------------------------------------------------------------------------
 Syntax

     STRTRAN(<cString>, <cSearch>,
        [<cReplace>], [<nStart>], [<nCount>]) --> cNewString

 Arguments

     <cString> is the character string or memo field to search.

     <cSearch> is the sequence of characters to locate.

     <cReplace> is the sequence of characters with which to replace
     <cSearch>.  If this argument is not specified, the specified instances
     of the search argument are replaced with a null string ("").

     <nStart> is the first occurrence that will be replaced.  If this
     argument is omitted, the default is one.

     <nCount> is the number of occurrences to replace.  If this argument
     is not specified, the default is all.

 Returns

     STRTRAN() returns a new character string with the specified instances of
     <cSearch> replaced with <cReplace>.

 Description

     STRTRAN() is a character function that performs a standard substring
     search within a character string.  When it finds a match, it replaces
     the search string with the specified replacement string.  All instances
     of <cSearch> are replaced unless <nStart> or <nCount> is specified.
     Note that STRTRAN() replaces substrings and, therefore, does not account
     for whole words.

 Examples

     .  This example uses STRTRAN() to establish a postmodern analog
        to a famous quotation:

        cString:= "To compute, or not to compute?"
        ? STRTRAN(cString, "compute", "be")
        // Result: To be, or not to be?

 Files:  Library is CLIPPER.LIB.

See Also: AT() HARDCR() MEMOTRAN() RAT() STUFF() SUBSTR()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson