HotDocs Author WorkflowCreate a template Add placeholders Group variables in dialogs Upload a template Create a script

TRIM Function

The TRIM function removes all space characters from the beginning and end of a text value you specify.

You can use this function to ensure that free-form answers entered in the interview do not begin or end with extraneous spaces that would otherwise cause inconsistencies in the document formatting.

The TRIM function is a shortcut for the STRIP function where the string of characters being removed is "\t\l" and characters are being stripped from both the beginning and ending of the text value. If you only want to trim white space from the beginning or ending, use STRIP with appropriate parameters instead.

Function name TRIM
Usage model TRIM ( t:TEXT )
Parameters This function requires you to replace only one parameter:

t: TEXT

The function removes any white spaces from the beginning and end of this text value.
Result A text value.

Example

If a text value begins or ends with white space, you can use the TRIM function in an expression to return the text value without the extra spaces:

TRIM ("    The client, Mary Rogers, has approved the conditions.      ")

The preceding expression would return a text value as follows:

"The client, Mary Rogers, has approved the conditions."