Trim Text Action

Description

Removes characters from the beginning and/or end of the specified text and places the result in a variable. Used to take spaces off the beginning or end of a text value. These spaces can sometimes be cause by data-entry error or formatting routines from external applications.

Declaration

<AMTEXTREMOVE TEXT="text" REMOVE="text" CHARACTERS="text" ACTION="text [options]" RESULTVARIABLE="text [varibable name]">

Example

<AMVARIABLE NAME="thevariable">  this text has spaces on the front</AMVARIABLE>
<AMMESSAGEBOX>%thevariable%</AMMESSAGEBOX>
<AMTEXTREMOVE TEXT="%thevariable%" RESULTVARIABLE="thevariable">
<AMMESSAGEBOX>%thevariable%</AMMESSAGEBOX>

General Tab Parameters

Text to remove from: Specifies the text to trim.  

Text, Required
MARKUP: TEXT="    text padded with spaces "

Remove from: Specifies how the text is trimmed.

  • beginning and end: The text is stripped from the beginning and end of the target text.

  • beginning: The text is stripped from the beginning of the target text.

  • end: The text is stripped from the end of the target text.

Text [options], Optional (default: beginning and end)
MARKUP: ACTION="remove_beginning"

Remove: Specifies the character(s) to remove from the string.

  • whitespace: All whitespace characters are removed from the string

  • carriage returns: Carriage returns are removed from the string

  • spaces: spaces are removed from the string

  • tabs: tabs are removed from the string

  • user defined: The text specified in the "Characters to Remove" parameter are removed from the string.

Text [options], Optional - Default: Whitespace
MARKUP: REMOVE="returns"

Characters to remove: If Remove is set to User Defined, specifies the user defined characters to remove..

Text, Required if Remove is "user"
MARKUP: CHARACTERS="x"

Populate variable with result: Specifies the variable to receive the new formatted value.

Text [variable name], Required
MARKUP: RESULTVARIABLE="varname"