Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>strtran()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
STRTRAN()


Syntax:     STRTRAN(<expC1>, <expC2> [,<expC3>] [,<expN1>]
            [,<expN2>])

Purpose:    To search and replace within a character string.

Arguments:  <expC1> is the character string to search.

            <expC2> is the sequence of characters to locate.

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

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

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

Returns:    A character string.

Usage:      STRTRAN() 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 the search string are replaced unless <expN2>
            is specified.

            Note that STRTRAN() replaces substrings and therefore does
            not account for whole words.

Library:    CLIPPER.LIB


----------------------------------- Example --------------------------------

   string = "To be, or not to be?"

   ? STRTRAN(string, "be", "compute")


   Result: To compute, or not to compute?


See Also: AT() RAT() SUBSTR()

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