Skip to main content
Version: Next

Trim String

Trims whitespace from the beginning and end of the string

Description

Removes whitespace from both ends of a string. Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (LF, CR, etc.).

Uses the trim JavaScript function.

See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank">string object</a>

Inputs

  • s (String): The string to trim.

Outputs

  • s.trim() (String): Trimmed string