TRIM - trim trailing blanks off a string.

Alternate Entry Name: .TRIM

Usage:

B:
   string = trim( string [, length] );
C:
   void trim(void string [, int length] );

Where:

string
points to the ASCII string to be stripped.
length
is the number of characters in "string". TRIM will go out this many characters and then proceed backwards, stripping off blanks. If "length" is not specified, TRIM will locate the '*0' which terminates "string" and strip backwards from there.

Description:

TRIM removes the trailing blanks from the end of "string". It does this by finding the end of the string, backing up over any blanks preceding this point, and putting a '*0' after the first non-blank character it finds. In other words, it doesn't really strip off blanks (since the blanks will still be there in memory) but it puts an end-of-string marker ('*0') after the last non-blank character.

Copyright © 1996, Thinkage Ltd.