Trimming Spaces directive

The TRIM, LTRIM, and RTRIM directives trim whitespace from both sides, left side or right side of a string values they are applied to.


trim :column ltrim :column rtrim :column

The directive performs an in-place trimming of space in the value specified by the column.


The trim directives honors UNICODE space characters. Following are the characters that are recognized as spaces by TRIM, LTRIM and RTRIM.






Character tabulation


Line Feed (LF)


Line Tabulation


Form Feed (FF)


Carriage Return (CR)

" "



Next line (NEL)


No Break Space


OGHAM Space Mark


Mongolian Vowel Separator


EN Quad


EM Quad


EN Space


EM Space


Three Per EM space


Four Per EM space


Six Per EM space


Figure Space


Punctuation Space


Thin Space


Hair Space


Line Separator


Paragraph Separator


Narrow No-Break Space


Medium Mathematical Space


Ideographic Space


Using this record as an example:

{ "id": 1, "gender": " male ", "fname": " Root ", "lname": " JOLTIE ", "address": " 67 MARS AVE, MARSCIty, Marsville, Mars" }

Applying these directives

trim :gender ltrim :fname rtrim :lname ltrim :address

results in this record:


Created in 2020 by Google Inc.