Skip to content

STRIP treats remove as chars list, not substring. #156

@python-processing-unit

Description

@python-processing-unit

According to the specification section 9.1.5:

STR: STRIP(STR: value, STR: remove) = MUST return value with every occurrence of the non-empty substring remove removed.

In the implementation, however, STRIP is implemented as a character-trim: builtin_strip in builtins.c uses strchr(chars, s[start]) / strchr(chars, s[end - 1]) and only removes characters from the ends (treating the second argument as a set of characters), rather than removing every occurrence of the substring.

Metadata

Metadata

Labels

bugSomething isn't workingpatchRequires a patch version change.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions