String.trim

String.trim

String.trim

Function

Remove leading and trailing whitespace characters from the string and return a new string.

Syntax

Parameters

No parameters.

Return value

TypeDescription
StringReturns a new string with leading and trailing whitespace removed.

Example

Notes

  • The original string is not modified.
  • Only the leading and trailing blanks are removed, and the blanks in the middle of the string are not processed.