Skip to content

Add trimDelimiter option#36

Open
ausi wants to merge 1 commit intomasterfrom
feature/trim-delimiter-option
Open

Add trimDelimiter option#36
ausi wants to merge 1 commit intomasterfrom
feature/trim-delimiter-option

Conversation

@ausi
Copy link
Owner

@ausi ausi commented Sep 8, 2023

Alternative to #35

@Rumi-Aguirre would this be enough for your use case?

@ausi ausi self-assigned this Sep 8, 2023
@Rumi-Aguirre
Copy link

For my needs I would really need to be able to differentiate between the initial and final delimiter, and to be able to remove one, both or none of them @ausi

@ausi
Copy link
Owner Author

ausi commented Sep 13, 2023

For this case it should be easy to remove the delimiter from one side after the generation, e.g.:

ltrim($generator->generate('-foo-', ['trimDelimiter' => false]), '-'); // foo-
rtrim($generator->generate('-foo-', ['trimDelimiter' => false]), '-'); // -foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants