Extract a substring beginning with the first character in a string

     LEFT(<cString>, <nCount>) --> cSubString


     <cString> is a character string from which to extract characters.
     The maximum size of <cString> is 65,535 (64K) bytes.

     <nCount> is the number of characters to extract.


     LEFT() returns the leftmost <nCount> characters of <cString> as a
     character string.  If <nCount> is negative or zero, LEFT() returns a
     null string ("").  If <nCount> is larger than the length of the
     character string, LEFT() returns the entire string.


     LEFT() is a character function that returns a substring of a specified
     character string.  It is the same as SUBSTR(<cString>, 1, <nCount>).
     LEFT() is also like RIGHT(), which returns a substring beginning with
     the last character in a string.

     LEFT(), RIGHT(), and SUBSTR() are often used with both the AT() and
     RAT() functions to locate the first and/or the last position of a
     substring before extracting it.


     .  This example extracts the first three characters from the left
        of the target string:

        ? LEFT("ABCDEF", 3)                  // Result: ABC

     .  This example extracts a substring from the beginning of a
        string up to the first occurrence of a comma:

        LOCAL cName := "James, William"
        ? LEFT(cName, AT(",", cName) - 1)   // Result: James

 Files   Library is CLIPPER.LIB.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.