Trim

Strings Pure
Trim
Text
Result

Description

Pure function returning the text with leading and trailing whitespace removed.

When to use

Use Trim to clean user-supplied or externally sourced strings before comparison, parsing, or storage. Combine with Is empty? to detect blank inputs after trimming — this correctly treats whitespace-only strings as empty. Trim is also useful before String to integer or String to boolean when input may contain surrounding spaces.

Pins

Input pins

Pin Type Default Notes
Text string The string to trim. Whitespace includes spaces, tabs, and newline characters.

Output pins

Pin Type Notes
Result string The string with leading and trailing whitespace removed.

Example

Validate that a form field is not blank after stripping whitespace. Read the request body with Stream to string, feed the Value output into the Text input of Trim, then wire the Result output into the Text input of Is empty?. Connect the Result output to the Condition input of Branch — a user submitting " " (spaces only) is caught by Is empty? after trimming and the True execution output routes to Fail with a “Field required” message.

See also