TRIM
- TRIM(value)[source]
Removes leading and trailing whitespace from a string or string array.
This function trims whitespace from each element if the input is a string array, or from the single string if the input is scalar.
- Parameters:
value (
Operand|str) – The string or string array to trim.- Return type:
- Returns:
A formula representing the trimmed string(s).
- Raises:
ValueError – If the input value is not STRING or STRING_ARRAY.
Examples
Trim a single string:
TRIM(" hello world ") # Returns "hello world"
Trim a string array:
TRIM([" foo ", " bar "]) # Returns ["foo", "bar"]
``value`` — accepted types
STRING
STRING_ARRAY
Return types
STRING
STRING_ARRAY