On this page

    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: Leading and trailing chracters to trim from the input expression. If this parameter is not specified, then the spaces will be trimmed from the input expression.

    Examples

    SELECT BTRIM('      dremio ')
    -- dremio
    
    SELECT BTRIM('~/~/~/dremio~', '~')
    -- /~/~/dremio
    
    SELECT BTRIM('---dremio-', '-')
    -- dremio
    
    SELECT BTRIM('stringvalue', 'string')
    -- value