Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support string function btrim #8935

Closed
neverchanje opened this issue Apr 3, 2023 · 1 comment · Fixed by #8985
Closed

Support string function btrim #8935

neverchanje opened this issue Apr 3, 2023 · 1 comment · Fixed by #8985
Assignees
Milestone

Comments

@neverchanje
Copy link
Contributor

neverchanje commented Apr 3, 2023

Syntax

BTRIM(string text [, characters text])

Description

The btrim function in Postgres is used to remove specified characters
from both the beginning and the end of a given text string. If no
characters are provided, the function removes whitespace characters by
default.

Parameters

  • string (text): The input text string from which characters will be
    removed.

  • characters (text) [optional]: The characters to remove from the
    beginning and end of the input text string. If not provided, the
    function will remove whitespace characters by default.

Returns

The function returns a text string with the specified characters removed
from the beginning and end.

Examples

SELECT BTRIM('   PostgreSQL   '); -- Returns 'PostgreSQL'
SELECT BTRIM('$$$PostgreSQL$$$', '$'); -- Returns 'PostgreSQL'

See Also

  • ltrim: Removes specified characters from the beginning (left side)
    of a given text string.

  • rtrim: Removes specified characters from the end (right side) of a
    given text string.

Compatibility

The btrim function is compatible with PostgreSQL and is part of the
SQL standard.

@github-actions github-actions bot added this to the release-0.19 milestone Apr 3, 2023
@neverchanje neverchanje changed the title trim / btrim / ltrim / rtrim (missing btrim) Support string function btrim Apr 3, 2023
@xiangjinwu
Copy link
Contributor

We have already supported trim, which has 3 modes: ltrim, rtrim, btrim. This is just missing an alias.

@xiangjinwu xiangjinwu self-assigned this Apr 4, 2023
@xiangjinwu xiangjinwu linked a pull request Apr 4, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants