Function Alltrim() Foundation

Removing leading and trailing blank spaces from a character string.

Syntax
Alltrim( <cString> ) --> cTrimmedString
Parameters
<String>
<cString> is a character string from which leading and trailing blank spaces are removed.
Return

The return value of Alltrim() is a copy of <cString> without leading and trailing blank spaces.

Description

The character function Alltrim() removes all blank spaces (Chr(32)) at the beginning and end of a character string. The similar functions LTrim() and RTrim() remove blank spaces only at the beginning or end of a character string. The counterpart to Alltrim() is the function PadC(), which adds blank spaces to the beginning and end of a character string.

Examples
Alltrim()
// The example uses the function Len() to 
// show the effect of Alltrim(). 

PROCEDURE Main 
   LOCAL cString := "     Xbase++  " 

   ? Len( cString )              // result: 14 

   ? Len( Alltrim(cString) )     // result: 7 

   ? Len( LTrim(cString) )       // result: 9 

   ? Len( RTrim(cString) )       // result: 12 

RETURN 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.