Text - Trim |
<AMTEXT ACTIVITY="trim" TEXT="text" RESULTVARIABLE="Text" ACTION="text (options)" CHARACTERS="text" ORDERED="Yes/No" /> |
Description:
Trims characters from the beginning and/or end of a text string and populates a variable with results.
Text manipulation. Used to take spaces off of the beginning or end of a text value. These spaces can sometimes be caused by data-entry error or a formatting routines from external applications.
General
Property |
Type |
Required |
Default |
Markup |
Description |
Text to remove from |
Text |
Yes |
(Empty) |
TEXT="My Name is Joe" |
The target text to be trimmed. As with every text parameter, if the data you wish to enter is contained in a variable, simply enter the variable name surrounded by percentage signs to resolve it to it's contents at runtime (e.g.,%VarName%). |
Remove from |
Text (options) |
No |
beginning and end |
|
Specifies where the text is trimmed. The available options are:
|
Remove |
Text (options) |
No |
Whitespace |
|
The character(s) to remove from the string. The available options are:
|
Characters to remove |
Text |
Yes if Remove is User defined |
(Empty) |
CHARACTERS="x" |
The user defined character(s) to remove. This parameter is active only if the Remove parameter is set to User defined. |
Characters can be in any order |
Yes/No |
No |
No |
ORDERED="NO" |
If set YES, characters to be removed can be in any order. If set to NO, characters to be removed must be in the order entered. |
Populate variable with result |
Text |
Yes |
(Empty) |
RESULTVARIABLE="varname" |
The name of the variable to receive the new formatted text value. |
NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder. |
Description:
A simple task that demonstrates the use of Trim Text action.
<AMVARIABLE NAME="theVar">|Hello World|</AMVARIABLE> <AMSHOWDIALOG MESSAGE="The text before Trim Text action: %theVar%" /> <AMTEXTREMOVE REMOVE="user" CHARACTERS="|" TEXT="%theVar%" RESULTVARIABLE="theVar" /> <AMSHOWDIALOG MESSAGE="The text after Trim Text action: %theVar%" />
|