Skip to main content
[Command] Trim spaces
Sophie avatar
Written by Sophie
Updated over 10 months ago

Definition and Usage

The Trim spaces command is used to remove whitespace characters from the beginning and/or end of a string. Whitespace characters include spaces, tabs, newlines etc. The command is useful for cleaning up strings extracted from files/websites before further processing, as it removes extra whitespace that may interfere with workflows.

Common use cases include:

  • Preprocessing strings before usage

  • Cleaning extracted data before analysis

  • Removing whitespace before import/export

  • Formatting strings for applications


Parameter Values

Set Parameters

Parameters

Description

Original text

Enter the text to trim or select a text variable

Operation

Specify how you'd like to trim the text

Save text as

Save the trimmed text as a new variable

Error handling

Parameter

Definition

When error occurs

Select the action to be performed when an error occurs

  • Terminate the project

  • Ignore the error and execute the next command

  • Retry action


Example

The above workflow removes leading and trailing whitespace in " Hello world! " thus gets the standard output: "Hello world!".
โ€‹

Did this answer your question?