BTRIM

Removes the longest string consisting only of specified characters from the start and end of a string.

Behavior Type

Immutable

Syntax

BTRIM ( expression [ , characters-to-remove ] )

Parameters

expression

(CHAR or VARCHAR) is the string to modify

characters-to-remove

(CHAR or VARCHAR) specifies the characters to remove. The default is the space character.

Example

=> SELECT BTRIM('xyxtrimyyx', 'xy');
 BTRIM
-------
 trim
(1 row)

See Also