Character functions
 
Function
Description
Custom or in VFP subset?
ALLTRIM(CHAR_VALUE)
 
This function trims all of the blanks from both the beginning and the end of the expression. This command accepts only alphanumeric data.
VFP subset
LTRIM(CHAR_VALUE)
 
This function trims any blanks from the beginning of the expression. This command accepts only alphanumeric data.
VFP subset
TRIM(CHAR_VALUE)
 
This function trims any blanks off the end of the expression. This command accepts only alphanumeric data.
VFP subset
LEFT(CHAR_VALUE, NUM_CHARS)
 
This function returns a specified number of characters from a character expression, beginning at the first character on the left. The parameter NUM_CHARS must be constant. See also: SUBSTR()
VFP subset
RIGHT(CHAR_VALUE, NUM_CHARS)
 
This function returns a specified number of characters from the end of a character expression. The parameter NUM_CHARS must be constant.
VFP subset
SUBSTR(CHAR_VALUE, START_POSITION, NUM_CHARS)
 
A substring of the character value is returned. The substring is NUM_CHARS long and starts at the START_POSITION character of CHAR_VALUE. The parameters START_POSITION and NUM_CHARS must be constant.
VFP subset
UPPER(CHAR_VALUE)
 
A character string is converted to uppercase and the result is returned.
VFP subset
 
Examples:
LEFT( ’SEQUITER’, 3) returns SEQ.
The same result could be achieved with SUBSTR(’SEQUITER’, 1, 3)
RIGHT( ’SEQUITER’, 3) returns TER.
SUBSTR( "ABCDE", 2, 3 ) returns BCD
SUBSTR( "Mr. Smith", 5, 1 ) returns S