Skip to content

Trim Operation: trim

The trim operation under the String Operations function is used to remove unnecessary spaces from a string. This includes spaces at the beginning and end, as well as extra spaces between words. The operation ensures clean and consistent string formatting for seamless automation workflows.

Example: Suppose you have a string “John    Doe” with extra spaces between words. You want to trim the extra spaces and store the cleaned string in a variable named TrimmedName.

Steps to Configure:

  1. Add a new step.
  2. Select Set a Variable Value from the Action dropdown.
  3. Enter a variable name in the Element Key field (e.g., TrimmedName). This variable will store the trimmed string.
  4. Click on Form, select Functions, and choose String Operations.
  5. Provide the following parameters:
    • Operation: Choose trim.
    • Data: Enter the string to be trimmed (e.g., “John    Doe“).
  6. Click Save.
scrn-trim-operation-tabular-view
Tabular View
scrn-trim-operation-card-view
Card View

Outcome on Execution:

  • The operation removes all leading, trailing, and extra spaces between words.
  • The updated string (“John Doe”) is stored in the variable defined in the Element Key field (e.g., TrimmedName).
  • This variable can be referenced in subsequent automation steps using the syntax ${VariableName} (e.g., ${TrimmedName}).

Back To Top