Skip to main content
Version: 0.0.1

BTRIM

Categories: String

BTRIM

Trims leading and trailing characters from a string.

Syntax

BTRIM(expression string [, trim_text string]) → string

  • expression: String expression to be trimmed.
  • trim_text (optional): 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

{{< codeheader "BTRIM example" >}}

SELECT BTRIM('      dremio ')
-- dremio

{{< codeheader "BTRIM example" >}}

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

{{< codeheader "BTRIM example" >}}

SELECT BTRIM('---dremio-', '-')
-- dremio

{{< codeheader "BTRIM example" >}}

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

{{< codeheader "BTRIM example" >}}

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