Handlebar Helper Function: Trim
Removes leading and trailing whitespace from a specified string value. The function can handle strings and attempts to convert other types to strings.
| Parameter | Type | Description |
|---|---|---|
subject | string | Required. The string value to trim. Must be a string or convertible to a string. |
The function returns the input with all whitespace characters—including spaces, tabs, and newlines—removed from the beginning and end of the string. If the input is null, the function returns an empty string. If the input isn't a string, the function converts it to a string and trims the whitespace.