trim
The trim() method removes whitespace from the start and end of a string. Whitespace includes spaces, tabs, line breaks, and other Unicode whitespace characters.
Interactive example
Syntax
typescript
function trim<
GenericInput extends string
>(input: GenericInput): stringParameters
input: The string from which to remove leading and trailing whitespace.
Return value
A new string representing the calling string without leading and trailing whitespace.
