danielstjules / Stringy

A PHP string manipulation library with multibyte support
MIT License
2.46k stars 216 forks source link

Allow hyphenated words option in titleize method. #197

Open leigh-ols opened 5 years ago

leigh-ols commented 5 years ago

At present hyphenated words such as 'up-to-date' would become 'Up-to-date'.

Allowing the option of treating hyphenated words as a individual words would be a nice feature:

s('up-to-date')->titleize(['to'], [' ', '-']);

Would return 'Up-to-Date'.

voku commented 5 years ago

@leigh-ols I added the feature in this fork, maybe you can take a look here: https://github.com/voku/Stringy/commit/84b6c1e3d82957e5213db378ad2b1d6837a4dbd1#diff-81e55517d73634753e211bc2deebe9c0R4319

leigh-ols commented 5 years ago

@voku Any chance of a pull request on this one? @danielstjules Would you be willing to implement this?

alexeyshockov commented 5 years ago

@leigh-ols, this repo seems abandoned since 2017... (#198)