andydune / string-container
Collection of functions fo string modification. Collection is composed as strategy pattern with simple extension.
v1.0.1
2019-06-21 11:45 UTC
Requires
- php: >=5.6
- voku/portable-utf8: 3.*
Requires (Dev)
- phpunit/phpunit: ^5.7.15 || ^6.0.8
This package is auto-updated.
Last update: 2024-11-22 03:04:19 UTC
README
It is collection of functions for string modification. Collection is composed as strategy pattern with simple extension.
Actions with string
Remove duplicate space symbols
It replaces spaces, tabs and so on for regular \s
with only one space symbol.
use AndyDune\StringContainer\StringContainer; $container = new StringContainer('Very cool.'); 'Very cool' == $container->removeDuplicateSpaces()->getString();
Remove duplicate words
It replaces words, if there are more then one in a string.
use AndyDune\StringContainer\StringContainer; $container = new StringContainer('Very very cool cooly.'); 'Very cool cooly.' == $container->removeDuplicateWords()->getString();