Trim()

Category: Text

Syntax: trim ( text )


Parameters:

textAny expression that resolves to a text string.

Data type returned: Text

Description:

Returns the specified text string with any leading or trailing spaces removed.

The TRim() function removes only leading and trailing spaces and not any other characters (such as carriage returns).

trim() can be used to reformat data where users have inadvertently typed spaces at the end of an entry. This happens frequently with fields containing first names. To automatically have the entry reformatted when the user exits the field, have the field auto-enter trim (FirstName) and uncheck the option not to replace any existing value in the field. Thus, if a user enters "Fred" into the FirstName field, it is replaced with "Fred" when the user exits the field.

TRim() is also used frequently to clean up fixed-width data that has been imported from some other data source. In such cases, fields have been padded with leading or trailing spaces to be a certain length. Remove them after importing by doing calculated replaces in the appropriate fields.

Examples:

Function

Results

trim (" This is a test ")

Returns This is a test.








FileMaker 8 Functions and Scripts Desk Reference
FileMaker 8 Functions and Scripts Desk Reference
ISBN: 0789735113
EAN: 2147483647
Year: 2004
Pages: 352
Simiral book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net