TRIM
All functions > STRING > TRIM
Returns the string with whitespace from both ends removed.
Signatures
Returns: String with leading and trailing whitespace removed
TRIM(string: VARCHAR) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | String to trim |
Notes
- Removes spaces, tabs, newlines, and other whitespace characters
- Whitespace in the middle of the string is preserved
- Does not remove non-whitespace characters
Examples
FeatureQL
SELECT
f1 := TRIM(' hello '), -- Trim both ends
f2 := TRIM(' world '), -- Trim tabs
f3 := TRIM(' mixed spaces '), -- Only trim ends
f4 := TRIM('no trim needed') -- No whitespace to trim
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR |
|---|---|---|---|
| hello | world | mixed spaces | no trim needed |
On this page