BTRIM

String Function

Description

The BTRIM function trims a string by removing leading and trailing blanks or by removing leading and trailing characters that match an optional specified string.

(RedShift SQL Language Reference BTRIM function)

Grammar Syntax

BTRIM(string [, trim_chars ] )

This function is fully supported by Snowflake.

Sample Source Patterns

Input Code:

IN -> Redshift_01.sql
SELECT '     abc    ' AS untrim, btrim('     abc    ') AS trim;

SELECT 'setuphistorycassettes' AS untrim, btrim('setuphistorycassettes', 'tes') AS trim;

Output Code:

OUT -> Redshift_01.sql
SELECT '     abc    ' AS untrim,
TRIM('     abc    ') AS trim;

SELECT 'setuphistorycassettes' AS untrim,
TRIM('setuphistorycassettes', 'tes') AS trim;

Know Issues

No issues were found.

There are no known issues.

Last updated