SQLite TRIM() Function
Example
Remove the spaces around a text:
SELECT '|' || TRIM(' SQL Tutorial ') || '|';
Try it Yourself »
Definition and Usage
The TRIM() function removes characters from both the start and the end of a text. By default, it removes spaces.
Tip: Also look at LTRIM(), RTRIM().
Syntax
TRIM(text, characters)
Parameter Values
| Parameter | Description |
|---|---|
| text | Required. The text |
| characters | Optional. The characters to remove. Default is a space |
Technical Details
| Return type: | Text |
|---|