Skip to content

str's trim_left and trim_right implicitly assume LTR text #30459

Closed
@huonw

Description

@huonw

These functions and their _matches variants operate on the start and end of the string, which are only the left and right (respectively) of the displayed text when rendered left-to-right like English. For (readers/users of) RTL languages, trim_right is hinting that it will be trimming the prefix, but this is of course not the case (and similarly for _left).

These are stable and there is precedent in other languages for left/right e.g. Python (there's also significant precedent for start/end), so we may not be able/want to do anything here, but it seems worth noting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions