Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.03 KB

File metadata and controls

49 lines (39 loc) · 1.03 KB
description
Trims leading and trailing characters from a string.

BTRIM

Syntax

BTRIM(expression string, trim_text string) → string

  • expression: String expression to be trimmed.
  • trim_text: Leading and trailing characters to trim from the input expression. If this parameter is not specified, then spaces will be trimmed from the input expression.

Examples

{% code title="BTRIM example" %}

SELECT BTRIM('spice ')
-- spice

{% endcode %}

{% code title="BTRIM example" %}

SELECT BTRIM('~/~/~/spice~', '~')
-- /~/~/spice

{% endcode %}

{% code title="BTRIM example" %}

SELECT BTRIM('---spice-', '-')
-- spice

{% endcode %}

{% code title="BTRIM example" %}

SELECT BTRIM('stringvalue','string')
-- value

{% endcode %}

{% code title="BTRIM example" %}

SELECT BTRIM('pancake pan','abnp')
-- cake

{% endcode %}